Stimuli at pos(0,0) displaying off-center across pyglet versions

I’ve noticed this has been an issue for people in the past, which has usually been solved by using an older version of pyglet; that, however, is not working for me.
Quite simply, stimuli which are not specified a pos value, or stimuli that are given (0,0) both appear in odd places not in the center of the window. On the newest version of Pyglet, stimuli appear about halfway across the screen on the left. In older versions of Pyglet, they usually appear much bigger, barely visible in the top right corner of the screen (with the same code, all at pos=(0,0), and the window is the right size). When I run it with Spyder, the stimuli will appear one place, then in the PsychoPy coder, the same exact code will put the stimulus somewhere else. This is really strange and frustrating; I am really hoping there is some other fix for this, because adjusting the position of the stimuli would be extremely tedious if not impossible.
The strange thing is if I make the window full-screen, suddenly the stimuli are in the right place, which would solve the issue if not for the fact that making it full-screen displays the window on the wrong monitor… In other words, I specify screen=1 to display the experiment on the correct monitor (in fullscr=False), but when fullscr=True, it will display the window on the wrong monitor regardless of screen=0 or 1 etc. What the heck??
Here is some sample code:

from psychopy import visual, event, core
windims = {"w":1600, "h":900}
win = visual.Window(
    size = [windims["w"], windims["h"]], pos = [0,0], fullscr=False, screen=1, 
    winType='pyglet', allowGUI=True, allowStencil=False,
    monitor = 'big', color='black', colorSpace='rgb',
    blendMode='avg', useFBO=True, 
    units='pix', useRetina = True)

instructions = visual.TextStim(win, text = "instructions yo", color = "magenta", 
                               pos = (0,0), height = windims['h']*.1)
fixation = visual.TextStim(win, text="+", color="white", height = windims['h']*.08)
instructions.draw()
win.flip()
core.wait(2)
fixation.draw()
win.flip()
core.wait(2)
win.close()

Worth mentioning I already tried changing alignHoriz, alignText, and setting the pos as halfway across the screen in pixels.

Hi, which version of PsychoPy is that, are you using the standalone package or did you install manually (if yes, how?), and which platform/operating system are you using?

I’m using v3.2.4 with the standalone package. On a macOS 10.14.16. Thanks,

I wonder if this may have to do with retina resolutions… @jon?

I don’t think that retina is the issue or we’d be seeing problems more widely still. @bwinston are you sure that the pyglet version has been correctly downgraded and there isn’t some other version that’s being used instead? It sounds like you have multiple python installations and that often leads to confusions. Could you verify the version (and the location of the imported lib) being used in the actual script:

import pyglet
print(pyglet.__version__)
print(pyglet)
1 Like

The retina display multi-monitor issue is still very much a problem. I’ve just avoided doing anything that requires multiple monitors if one of them is a Retina, which basically means running off a PC or running it directly on the laptop or iMac.

I’m getting a potentially related issue in the latest version where even with one screen on a retina display, a window (but not a dialog box) will spawn way down and to the right. I think there’s still some kind of positioning mismatch with Pyglet. Haven’t had time to dig into it deeply, but I have some time this week so I might do some poking around.

1 Like

Cheers Jon and Jonathan. I downgraded pyglet again and used it just on the Mac display and things seem okay in terms of text position. Position of window/multi-monitor stuff is still wonky, but that seems like a separate battle. Thanks for your help.

Ah, so it the issue is with a dual retina/non-retina combo. I see. I’ll look into what happens there - maybe there’s some confusion about which resolution to use when two are present. thanks

2 Likes

my stims were glitchy too despite set at (0,0), then I changed my imagestim name (replaced final underscores with letters) and the problem was fixed.