esdalmaijer / PyGaze

an open-source, cross-platform toolbox for minimal-effort programming of eye tracking experiments
www.pygaze.org
GNU General Public License v3.0
671 stars 211 forks source link

PsychoPyDisplay instance has no attribute 'expdisplay' #65

Closed hannehuygelier closed 6 years ago

hannehuygelier commented 8 years ago

Dear Edwin,

I had the same problem as posted on this blog: http://forum.cogsci.nl/index.php?p=/discussion/2124/solved-cant-create-gabor/p1 .

However, the solution you posted there does not solve the problem (I also did not really understand the solution, since it was not integrated in a larger part of the code). With the code beneath I get the following error message: AttributeError: PsychoPyDisplay instance has no attribute 'units'.

This is a snippet of my code:

    # Create window: pygaze works by default with pixels
    disp = Display(disptype = 'psychopy', screennr = 0, bgc = "grey") 
    win = pygaze.expdisplay

    fixation = TextStim(win = disp, text = "+", pos = [0,0], color = "white", height = monitorunittools.deg2pix(1.0, mon, correctFlat = False))

    instruction = ImageStim(win = disp, image = instr + instr_files[0], interpolate = True) 
hannehuygelier commented 8 years ago

For people who might run into the same issue, I just had to use the win instead of disp as the argument for the window in the TextStim and ImageStim functions.

cherepaha commented 7 years ago

This seems to be a documentation issue, I just created #78 for the problem to be explicitly formulated. In the end, what you've done with win = pygaze.expdisplay is exactly what is needed, it's just not reflected in the docs