Objects change size when I exit full screen (spatial units set to height)

In my experiment there is a set of objects (a photo and some text) that should stay on the screen across routines (i.e. events in the trial), thus I have copy pasted object components across routines in the Psychopy Builder. It’s also important to calibrate the sizes of these objects to the screen size, so I use screen height as a spatial units when specifying sizes of these objects.

This all works great in the full screen mode, and all the sizes are consistent and calibrated to the screen, but when I exit the full screen mode, some of the objects change their sizes (get smaller) while others do not. It seems like exiting the full screen mode influences the height reference of a pretty random set of objects (location and size settings do not differ across these objects).

I tried changing the object size and location specifications from being “constant” to being “set every repeat”, but that did not resolve the issue, these multiple height references do not seem to be refreshed on every repeat.

Could I possibly gain control over when the “height” unit reference is refreshed?

here’s a link to my task: TBDTask [PsychoPy]

Thanks for sharing your task, ideally all objects should update live to match screen height changes so this is helpful for identifying what to work on.

To keep sizes constant irrespective of screen size, you could get the screen size at experiment start via win.size and store it in a variable (let’s call it scrSize) and then calculate the size of your components in pix units using this value. So to set it to 0.5 height, you would instead do 0.5*scrSize[1]. Keep in mind with this approach that it’s safest to use “set every repeat” so that scrSize definitely exists by the time the size or pos is actually set.