Millisecond Forums

Conditional Color

https://forums.millisecond.com/Topic21438.aspx

By aquirk - 4/26/2017

I want to update the pursuit rotor task script (where a circle rotates around the screen, and participants have to keep their mouse on the circle) so that the color of the rotating circle changes dependent on whether the mouse is touching it or not. I think the code should look something like:

if (values.current_targetlocation = 0) {
shape.animatedCircle.color = white
};
else {
shape.animatedCircle.color = blue
}
]

but I can't figure out where to put this. Is there a way to put if/else statements in the color attribute? Or an attribute within the trial section I could use? /ontrialbegin doesn't seem to work.
By Dave - 4/26/2017

aquirk - Wednesday, April 26, 2017
I want to update the pursuit rotor task script (where a circle rotates around the screen, and participants have to keep their mouse on the circle) so that the color of the rotating circle changes dependent on whether the mouse is touching it or not. I think the code should look something like:

if (values.current_targetlocation = 0) {
shape.animatedCircle.color = white
};
else {
shape.animatedCircle.color = blue
}
]

but I can't figure out where to put this. Is there a way to put if/else statements in the color attribute? Or an attribute within the trial section I could use? /ontrialbegin doesn't seem to work.

If you wish to use the Inquisit 5-version of the script, it's not technically possible to alter the color mid-trial during <trial rotate> based on whether the mouse is on- or off-target.

However, you can use the Inquisit 4-version, which is implemented differently due to the lack of bespoke animation features:

https://www.millisecond.com/download/library/v4/pursuitrotor/pursuitrotor.iqx

The Inquisit 4 version can (and does!) change the color of the circle depending on whether the cursor is on- or off-target.
By aquirk - 4/26/2017

Dave - Wednesday, April 26, 2017
aquirk - Wednesday, April 26, 2017
I want to update the pursuit rotor task script (where a circle rotates around the screen, and participants have to keep their mouse on the circle) so that the color of the rotating circle changes dependent on whether the mouse is touching it or not. I think the code should look something like:

if (values.current_targetlocation = 0) {
shape.animatedCircle.color = white
};
else {
shape.animatedCircle.color = blue
}
]

but I can't figure out where to put this. Is there a way to put if/else statements in the color attribute? Or an attribute within the trial section I could use? /ontrialbegin doesn't seem to work.

If you wish to use the Inquisit 5-version of the script, it's not technically possible to alter the color mid-trial during <trial rotate> based on whether the mouse is on- or off-target.

However, you can use the Inquisit 4-version, which is implemented differently due to the lack of bespoke animation features:

https://www.millisecond.com/download/library/v4/pursuitrotor/pursuitrotor.iqx

The Inquisit 4 version can (and does!) change the color of the circle depending on whether the cursor is on- or off-target.

Thank you!