How to Display Multiple Squares Simultaneously- Adjusting the positions

Hello, I am new to Psychopy and my task is to create an online experiment and show 6 different color of squares at the same. There will be a fixation cross at the center and squares will surround it. Next, after a break, only one of the squares will change color and participants should click to the square they think changed color. For that, I created a spreadsheet where I listed the colors and positions, next I entered the name of the columns to the position and color in polygon properties and created the squares in the builder. But first I got ‘ReferenceError: square_1_x is not defined’. Then, I manually entered the positions, since the positions will be the same. But this time although I entered the durations of all the squares as to start at 0 to 250 ms and their positions were different, the squares are showing one by one at the center, as I entered the loop type sequential I guess. I thought that for every trial I could create a row for squares. How can I adjust the positions to show all squares simultaneously? I am attaching screenshots below. Thank you very much!


When you got this error were the positions set to constant?

Your size appears to be in pixels and your position in height units. That will be why they are all at the centre.

1 Like

Hi, thank you very much for your quick response!

-Yes, positions were constant. Is that wrong? Since both in display trial and test trial the positions of the squares will be the same, I thought that is how it should be.

If a parameter is set to constant then it either needs to contain fixed values (e.g. (-0.1,0.5) or a variable which has been set in the Begin Experiment tab of a code component that appears earlier in the experiment.

square_1_x comes from your spreadsheet and therefore isn’t available until after the loop starts, at which point set every repeat would be needed.

-Was using pixels a mistake? If so, what should I use instead? I thought the position values ranged from 0 to 1. Could the way I entered them in the spreadsheet be the issue? Should I use pixels or height for the both position and size then? and how I would be adjusting the position in pixels or size if I need to use height?

Thank you so much!

You choose your spatial units in experiment settings (unless you override them in a component).

For online experiments I would recommend height units. The shortest dimension of the screen has a value of 1 (from -.5 to .5)

so if I use fixed values and update the spreadsheet like that, and enter that values to the polygon properties there wouldn’t be an issue. right?

If sq_1 is always in the same place then its position should be constant and its position values aren’t needed in the spreadsheet.

1 Like

thank you! but since this is only one part of our experiment and I will need to add additional task where we will need to make sure everybody is seeing the same size of stimuli I thought I should use pixels for that and use your screen scale. In this case, with the pixels in size how should I adjust the positions in pixels?

My screen scale routine will work with height, norm or pixel units.

You can use pixels if you want but then you need to use pixels for position as well as size.

Sizes and positions adjusted by my screen scale routine do need to be set every repeat since the values of x_scale and y_scale aren’t known at Begin Experiment.

thank you ! So for this part of the experiment, we are not worried about everyone seeing the same size of squares for the changing squares, I did not think I should use the screen scale and apply the values derived from them. I am not sure if I understood how I should be adjusting the positions in pixels could you please clarify that?

Where on the screen do you want your squares? Since they are 80 pixels wide maybe try (-80,240).

I created columns for positions as well and set it to set every repeat, done! thank you very much for your help.