Conditional Color


Author
Message
aquirk
aquirk
Esteemed Member (2.5K reputation)Esteemed Member (2.5K reputation)Esteemed Member (2.5K reputation)Esteemed Member (2.5K reputation)Esteemed Member (2.5K reputation)Esteemed Member (2.5K reputation)Esteemed Member (2.5K reputation)Esteemed Member (2.5K reputation)Esteemed Member (2.5K reputation)
Group: Forum Members
Posts: 31, Visits: 70
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.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View

Reading This Topic

Explore
Messages
Mentions
Search