Image revealed when effort response made

If this template helps then use it. If not then just delete and start from scratch.

Hi everyone,

I’m going to design a task where an image is revealed (with 0 being not at all visible to 100 being totally visible), when effort is made. To keep this simple to begin with I was going to design it so that as keyboard responses are made these correspond to the level of image revealed. So in a trail no keyboard response means the image is black/blank. As many keyboard responses are made I want the effect to be that the image becomes more visible. The underpinning idea being that as we make effort we get the information from the image. I will use the foundation build to intergrate a hand dynamometer in time, but wanted to start simple.

Has anyone done this before and/or have any code/build they could share as a starting point? I’ve checked the demo builds but couldn’t spot anything that similar so thought I would ask.

This is a code snippet I’ve seen on another post relating to image which I think could be a good starting point:

# Begin Routine
image.size = (0, 0)

Each Frame

if condition == True:
image.size = (.5, .5)

Thanks in advance!

Charlotte

How about using opacity?

Begin Routine

thisOpacity = 0

Each Frame

if key_resp.keys:
     thisOpacity = len(key_resp.keys)/20

Then set key_resp to record all responses and the image to have opacity thisOpacity updating every frame.

thanks, wakecarter. I’ll give it a go!

Charlotte

Works a treat. Thank you.