Dear all,
I am writing an experiment where, on a given trial, I draw a bunch of custom polygons (say 2) and then give the participants the control to change the position (via mouse click and drag), orientation (via mouse click + left and right arrow keys). I also want the participant to be able to change the the relative depth, say via up down arrow keys (i.e. in order to bring shape 2 in front of 1 or vice versa).
Position and orientation changes work fine. Also, the depth parameter of the polygon is clearly updated (I am reading it out for checking). However, the actual displayed depth is never changed, i.e. it does not reflect the numerical changes in depth made by the participant.
I have seen in the documentation that depth is deprecated. Is this why this parameter does not get updated when the participant changes its value via key press?
If it helps, here the bit of code that shows how, for example orientation and position changes work, but depth changes do not…
I greatly appreciate any help!
Best,
Katja
#######
if (piece.contains(mouse) and mouse.getPressed()[0] == 1 and ‘left’ in keys):
piece.ori+=2.0
elif (piece.contains(mouse) and mouse.getPressed()[0] == 1 and 'right' in keys):
piece.ori-=2.0
break
if (piece.contains(mouse) and mouse.getPressed()[0] == 1 and 'up' in keys):
piece.depth+=1.0
elif (piece.contains(mouse) and mouse.getPressed()[0] == 1 and 'down' in keys):
piece.depth-=1.0
break