psychopy.org | Reference | Downloads | Github

visual.TextStim doesn't draw text in the center of the screen in the new version of psychopy

in the visual.TextStim the center of the screen is not [0.0, 0.0] anymore.

look I run this code:

from psychopy import visual
import psychopy
import numpy as np

win = visual.Window(
    size=[width, height],
    units="pix",
    fullscr=True)

win.flip()
text = visual.TextStim(win=win, text='O', pos=[0.0, 0.0])
text.draw()
win.flip()
psychopy.event.waitKeys()
win.close()

instead of drawing an O in the center of the screen, it draws the O somewhere on the left. see the screenshot below.

I am using the last version of psychopy.

Are you using the standalone version of PsychoPy?

If not, what version of pyglet do you have installed? See this thread:

what does it mean “the standalone version of PsychoPy”? I insalled it on the 11th of October (2 days ago) via the command “pip install psychopy”, so it is the last version 3.2.3.

The version of pyglet is 1.4.5. So, should I just downgrade pyglet to 1.3.2 to solve the issue?

You can download PsychoPy as a standalone double-clickable application on Mac and Windows, which bundles all of the dependencies, largely avoiding issues like this.

I don’t know, I’m just going off that thread above. This can unfortunately be the kind of troubleshooting that is required if you are managing dependencies yourself rather than using the standalone installer.

but the standalone version is the psychopy builder, right? I do not want the builder. I use want to use the function in python.

okay! it works fine if I just downgrade pyglet to the version 1.3.2. If I install any version of pyglet from 1.4.0 to 1.4.5, i see the bug.