Screen size and button position

OS (e.g. Win10): Win10
PsychoPy version (e.g. 1.84.x): 2021.1.2

What are you trying to achieve?:
Hello again! Last time i posted i had some trouble finishing my program and i’m happy to tell you that it works!

Here is a sample image to help you guys:

Where those four circles are buttons for the participant to click or touch. But here’s the deal…this is set up for a 1366x768 screen (full screen). When someone runs the program on a 1920x1080 screen, it shows the image too small. One issue is that since this is a visuospatial abilities test, the stimulus has to be 100% standarized on all screens.

What did you try to make it work?:
I found a program on the forums that resizes the image according to the screen size called Screenscale Master. Using a real credit card, the partipant can adjust the size of a virtual card on the screen, which generates 2 variables i can use to resize the stimulus image according to the virtual card size.

What specifically went wrong when you tried that?:
That seems to solve one issue, but i don’t know how to reposition the buttons and instructions according to the screen size.

An extreme example of what i’m talking about:

Is there a way to use the variables generated by the virtual card size to reposition this other stuff?

Thank you!

Yes, but how are you currently positioning the buttons? You need to use the screen scale results for position as well as size.

Hi! Right now i’m using constant values to position the buttons (eg. (0.187, 0.17)). How can i use the screen scale result as a position variable?

What is the size of your rectangle?

The stimulus in the middle, you say? If so, 388x612 pixels. I can also get a better quality.

On the program, i was using it with the original size. Now, it’s size is (10*x_scale, 15.7*y_scale). I figured i should multiply y_scale by 15.7 instead of 10, since vertically the image is 1.57 times bigger than horizontally. Might be wrong, but it seems to work pretty well.

Try (4x_scale, 7y_scale) for the top right hand corner. That should be 4cm to the right and 7 cm above the centre of the screen.

Alternatively, use a ruler on a screen where the rectangle is 10cm wide and 15.7cm high to measure the desired locations of the buttons.

Thank you, that helped a lot! Now i have to figure out the right multipliers, unless there is an easier way to do it, 'cause right now the Y axis is waaaay off.

Do you have a code that shows a ruler on the screen?

There is an easy way but I don’t have the information.

You have an image which is 388x612 pixels and is about right on a 1366x768 screen.

To make it cover the same proportion of any screen you don’t need screenscale, just use height units, in which case your image is (388/768,612/768) = (0.5,0.8) approx.

In height units the top right hand corner of your image will be (.25,.4).

The value you gave of (0.187,0.17) might already be in height units and therefore not need any modification.

Screenscale is intended to be used when someone wants to have a fixed size in cm on the screen. (10x_scale, 15.7y_scale) means you want 10cm wide and 15.7cm tall, irrespective of the size of the screen. If that’s what you want, then you need to work out the desired positions in cm of your objects. However, I’m not yet convinced you do want this.

Nice, i think that worked! Thank you!