forked from psychopy/psychopy
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: more on Window.viewScale, .viewPos
with outline of a test
- Loading branch information
1 parent
ff76914
commit 6284c5b
Showing
3 changed files
with
35 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# test window.viewScale and .viewPos simultaneous and negative-going values | ||
# the green square/rect should move clockwise around the text | ||
|
||
from psychopy import visual, event | ||
|
||
win = visual.Window(size=(400,400), units='pix') #, viewOri=30) test viewOri here | ||
|
||
v = [(1,1),(1,-1),(-1,-1),(-1,1)] # vertices to use = square | ||
n = 30 # size of the square | ||
pimg= (n,n) # position for the image | ||
pgrn = (-n,-n) # position for green square | ||
|
||
for offset in [(0,0), (-.4,0)]: | ||
win.viewPos = offset | ||
for scale in [[1,1], # normal: green at lower left | ||
[1,-1], # mirror vert only: green appears to move up, text mirrored | ||
[-1,-1], # mirror horiz & vert: green appears to move right, text normal but upside down | ||
[-1,1], # mirror horiz only: green appears to move down, text mirrored | ||
[2,2],[2,-2],[-2,-2],[-2,2]]: # same, but both larger | ||
win.viewScale = scale | ||
grn = visual.ShapeStim(win, vertices=v, pos=pgrn, size=n, fillColor='darkgreen') | ||
img = visual.ImageStim(win, image='s.png', pos=pimg) | ||
grn.draw() | ||
img.draw() | ||
win.flip() | ||
event.waitKeys() |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters