Advertisement
smathot

PsychoPy texture demonstration

Jan 4th, 2013
733
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. from psychopy.visual import GratingStim, TextStim
  2. import numpy as np
  3.  
  4. size = 256
  5. x = -size
  6. y = size
  7. for tex in ['sin', 'sqr', 'saw', 'tri']:
  8.     myStim = GratingStim(win, tex=tex, sf=.01, mask=None, size=size/1.5, pos=(x+size/2,y-size/2))
  9.     myStim.draw()  
  10.     myText = TextStim(win, tex, pos=(x+size/2,y-size/2), color='#729fcf')
  11.     myText.draw()
  12.     x += size
  13.     if x >= size:
  14.         x = -size
  15.         y -= size      
  16. win.flip()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement