Thanks Koloman,
I have written the following function to modify the target VCODES:
function VCODES_OUT = Feedback_Ring(Ring_state, Cursor_X, Cursor_Y, VCODES_IN)
VCODES = VCODES_IN;
radii = hypot((Cursor_X -VCODES(3)), (Cursor_Y-VCODES(4))); %determine distance of cursor from start target center
if Ring_state == 1;
VCODES(10) = radii;
VCODES(5) = -2^31; % set to no-fill
% Set stroke value to ‘green’ by converting to uint32 format
full = (2^32 – 1);
VCODES(6) =(full*(2^64)) + full; % THIS DOES NOT WORK
else
VCODES(10) = VCODES(10);
end
VCODES_OUT = VCODES;
end
But I am unclear as to how I can change the stroke colour to green. Specifically how to format in uint32. Are you able to assist with this?
Great! Thanks
Please login or Register to submit your answer
Hello,
I would like to replace cursor feedback with a ring centred at a start target that changes radius as a function of cursor position (distance from the start target).
I have added ring_state to the main trial block in indicate when the ring should be switched on, and have created a hollow target for the ring. The ring’s location is provided by the parameters table (entered into the target block). I am not sure how to bypass the VISUAL_RADIUS value from the parameter table in order to change the radius of the ring dynamically.
Can I simply modify the VCODES that leave the target block with a function that replaces VCode(10) with the distance of cursor position and start target, or should I modify the target row inputs that enter the target block? Thanks in advance.
Chris