Text stimulus position in pixel

OS (e.g. Win10): Win10
PsychoPy version (e.g. 1.84.x): 3
Standard Standalone? (y/n) y
What are you trying to achieve?:
Hi everyone,
I´m programming a memory experiment. Participants are presented two lists of four digits. Each digit is presented in the centre of a polygon. Four polygons are arranged side by side, so that a “list” is created. I defined the size and the position of the polygons in pixels (it´s the info I have from a previous experiment, which was programmed in C++, so in order to make the stimuli as similar as possible, I used pixels as well), which works absolutely fine. What doesn´t work is to define the position of the text stimulus in pixels…As soon as I set “pix” as unit, the text stimuli are not presented anymore.

Here is the code snippet where the polygons and text stimuli are defined:

polygonR = visual.Rect(
    win=win, name='polygonR',units='pix', 
    width=(50,50)[0], height=(50,50)[1],
    ori=0, pos=(-100,50 ),
    lineWidth=2, lineColor=1.0, lineColorSpace='rgb',
    fillColor=[-1,-1,-1], fillColorSpace='rgb',
    opacity=1, depth=-1.0, interpolate=True)
polygonR_2 = visual.Rect(
    win=win, name='polygonR_2',units='pix', 
    width=(50,50)[0], height=(50,50)[1],
    ori=0, pos=(-50, 50),
    lineWidth=2, lineColor=1.0, lineColorSpace='rgb',
    fillColor=[-1,-1,-1], fillColorSpace='rgb',
    opacity=1, depth=-2.0, interpolate=True)
polygonR_3 = visual.Rect(
    win=win, name='polygonR_3',units='pix', 
    width=(50,50)[0], height=(50,50)[1],
    ori=0, pos=(0, 50),
    lineWidth=2, lineColor=1.0, lineColorSpace='rgb',
    fillColor=[-1,-1,-1], fillColorSpace='rgb',
    opacity=1, depth=-3.0, interpolate=True)
polygonR_4 = visual.Rect(
    win=win, name='polygonR_4',units='pix', 
    width=(50,50)[0], height=(50,50)[1],
    ori=0, pos=(50,50),
    lineWidth=2, lineColor=1.0, lineColorSpace='rgb',
    fillColor=[-1,-1,-1], fillColorSpace='rgb',
    opacity=1, depth=-4.0, interpolate=True)
polygonB_1 = visual.Rect(
    win=win, name='polygonB_1',units='pix', 
    width=(50,50)[0], height=(50,50)[1],
    ori=0, pos=(-100, -50),
    lineWidth=2, lineColor=1.0, lineColorSpace='rgb',
    fillColor=[-1,-1,-1], fillColorSpace='rgb',
    opacity=1, depth=-5.0, interpolate=True)
polygonB_2 = visual.Rect(
    win=win, name='polygonB_2',units='pix', 
    width=(50,50)[0], height=(50,50)[1],
    ori=0, pos=(-50, -50),
    lineWidth=2, lineColor=1.0, lineColorSpace='rgb',
    fillColor=[-1,-1,-1], fillColorSpace='rgb',
    opacity=1, depth=-6.0, interpolate=True)
polygonB_3 = visual.Rect(
    win=win, name='polygonB_3',units='pix', 
    width=(50,50)[0], height=(50,50)[1],
    ori=0, pos=(0, -50),
    lineWidth=2, lineColor=1.0, lineColorSpace='rgb',
    fillColor=[-1,-1,-1], fillColorSpace='rgb',
    opacity=1, depth=-7.0, interpolate=True)
polygonB_4 = visual.Rect(
    win=win, name='polygonB_4',units='pix', 
    width=(50,50)[0], height=(50,50)[1],
    ori=0, pos=(50, -50),
    lineWidth=2, lineColor=1.0, lineColorSpace='rgb',
    fillColor=[-1,-1,-1], fillColorSpace='rgb',
    opacity=1, depth=-8.0, interpolate=True)
digit1 = visual.TextStim(win=win, name='digit1',
    text=None,
    font='Arial Bold',
    units='norm', pos=(-0.075, 0.05), height=0.08, wrapWidth=None, ori=0, 
    color='white', colorSpace='rgb', opacity=1, 
    languageStyle='LTR',
    depth=-9.0);
digit2 = visual.TextStim(win=win, name='digit2',
    text='\n\n',
    font='Arial Bold',
    units='pix', pos=[-25,50], height=0.08, wrapWidth=None, ori=0, 
    color='white', colorSpace='rgb', opacity=1, 
    languageStyle='LTR',
    depth=-10.0);
digit3 = visual.TextStim(win=win, name='digit3',
    text='\n',
    font='Arial Bold',
    units='pix', pos=[25,50], height=0.08, wrapWidth=None, ori=0, 
    color='white', colorSpace='rgb', opacity=1, 
    languageStyle='LTR',
    depth=-11.0);
digit4 = visual.TextStim(win=win, name='digit4',
    text=None,
    font='Arial Bold',
    units='pix', pos=[75,50], height=0.08, wrapWidth=None, ori=0, 
    color='white', colorSpace='rgb', opacity=1, 
    languageStyle='LTR',
    depth=-12.0);
digit5 = visual.TextStim(win=win, name='digit5',
    text=None,
    font='Arial Bold',
    units='pix', pos=[-75,-50], height=0.08, wrapWidth=None, ori=0, 
    color='white', colorSpace='rgb', opacity=1, 
    languageStyle='LTR',
    depth=-13.0);
digit6 = visual.TextStim(win=win, name='digit6',
    text='\n',
    font='Arial Bold',
    units='pix', pos=[-25,-50], height=0.08, wrapWidth=None, ori=0, 
    color='white', colorSpace='rgb', opacity=1, 
    languageStyle='LTR',
    depth=-14.0);
digit7 = visual.TextStim(win=win, name='digit7',
    text='\n\n\n',
    font='Arial Bold',
    units='pix', pos=[25,-50], height=0.08, wrapWidth=None, ori=0, 
    color='white', colorSpace='rgb', opacity=1, 
    languageStyle='LTR',
    depth=-15.0);
digit8 = visual.TextStim(win=win, name='digit8',
    text=None,
    font='Arial Bold',
    units='pix', pos=[75,-50], height=0.08, wrapWidth=None, ori=0, 
    color='white', colorSpace='rgb', opacity=1, 
    languageStyle='LTR',
    depth=-16.0);
digit1.text = digit_1
digit2.text = digit_1
digit3.text = digit_1
digit4.text = digit_1
digit5.text = digit_1
digit6.text = digit_1
digit7.text = digit_1
digit8.text = digit_1

I was playing around with the units, e.g. if I set the units for one text stimulus to “norm” and changed the values, this stimulus was presented. Is anyone having any ideas…?Any kind of help is appreciated :wink: Thanks in advance!

1 Like

Ok sorry, I uploaded the wrong screenshot…here´s the example for the settings of my text stimulus:

1 Like

Ok, kind of embarrassing but I found the solution…I simply forgot to change the value of the letter height :upside_down_face:

2 Likes

I just wanted to let you know that I had the same issue and your post saved me! :slight_smile:

2 Likes