Search code examples
pythonpython-3.xpython-2.7psychopy

Why does psychopy.visual.TextStim not render text when I set pos=[50,0]?


I would like to render text on to the right side of a visual.Window using visual.TextStim. When I set the position of the TextStim to 0:

my_text = visual.TextStim(win, pos=[0,0])

The text appears on-screen. But when I change this to:

my_text = visual.TextStim(win, pos=[50,0])

for example. The text does not appear. I have tried this using python 3.6, psychopy 1.90.2. How can I use TextStim to display text stimuli to the right of the visual.Window?


Solution

  • Probably you haven't specified the units for the stimulus:

    my_text = visual.TextStim(win, pos=[50,0], units='pix')

    my_text = visual.TextStim(win, pos=[0.5,0], units='norm')

    You probably used default units of 'norm' and the text rendered 50 screen-widths to the right!