Win10:
2020:
Standalone:
What are you trying to achieve?:
I have a fully working experiment and wanted to see if I could make it work using “norm” instead of “pixels” for online purposes.
All was fine, except for one part of my code snippet. Originally it was just instructing python to update a dictionary if a click was within 150 pixels:
if not skipThisTrial:
if((mouse.x[0] >= xloc-150) and (mouse.x[0] <= xloc+150) and (mouse.y[0] >= yloc-150) and (mouse.y[0] <= yloc+150)):
obs_dict[image] +=1
else:
obs_dict[image]=0
so I thought (hoped) it would be as easy as having the experiment set to norm in the new version of the experiment and popping in my chosen norm units (0.5):
if not skipThisTrial:
if((mouse.x[0] >= xloc-0.5) and (mouse.x[0] <= xloc+0.5) and (mouse.y[0] >= yloc-0.5) and (mouse.y[0] <= yloc+0.5)):
obs_dict[image] +=1
else:
obs_dict[image]=0
But of course life doesn’t work out as you plan it to, and the following error popped up:
AttributeError: ‘Mouse’ object has no attribute ‘x’
Anyone know why?
Cheers,
Tom