+x Dave - 6/20/2024+x Dave - 6/20/2024+x MattJohnson - 6/20/2024Hi, just wondering if there is a way to change responsex and responsey from pixels to percentages? If not, is there a way to change picture.position to pixels if you're using a values attributes as x and y values? I'm trying to build a task where participants click on a target (or close to it). The target will be masked and change location on each trial. Participants will then receive points based on how close their response is to the target; more points the closer to the target the participant clicks. I've managed to build the basic skeleton, but just stuck with mismatched response units. Any helps is greatly appreciated.The stimulus element's (here: <picture>) xpx property gives you the horizontal pixel coordinate, the ypx gives you the vertical pixel coordinate.https://www.millisecond.com/support/docs/current/html/language/properties/xpx.htmhttps://www.millisecond.com/support/docs/current/html/language/properties/ypx.htmHere's a quick and dirty example:<values>/ targetx = 0/ targety = 0/ targetxpx = 0/ targetypx = 0/ points = 0/ totalPoints = 0/ responsex = 0/ responsey = 0/ distancepx = 0</values><block myblock>/ trials = [1-10 = trial.mytrial]</block><trial mytrial>/ ontrialbegin = [ values.targetx = floor(randgaussian(50,20)); values.targety = floor(randgaussian(50,20)); ]/ ontrialend = [ values.targetxpx = picture.cir.xpx; values.targetypx = picture.cir.ypx; values.responsex = trial.mytrial.responsex; values.responsey = trial.mytrial.responsey; values.distancepx = sqrt(pow((values.responsex - values.targetxpx), 2) + pow((values.responsey - values.targetypx), 2));]/ stimulustimes = [0 = fixation; 800 = clearscreen; 850 = cir]/ inputdevice = mouse/ validresponse = (lbuttondblclk)</trial><item cir_file>/ 1 = "cir.png"</item><picture cir>/ items = cir_file/ size = (10%, 10%)/ position = (values.targetx, values.targety)</picture><text fixation>/ items = ("+")</text><data>/ columns = (trialnum values.targetx values.targety values.targetxpx values.targetypx values.responsex values.responsey values.distancepx)</data>
+x Dave - 6/20/2024+x MattJohnson - 6/20/2024Hi, just wondering if there is a way to change responsex and responsey from pixels to percentages? If not, is there a way to change picture.position to pixels if you're using a values attributes as x and y values? I'm trying to build a task where participants click on a target (or close to it). The target will be masked and change location on each trial. Participants will then receive points based on how close their response is to the target; more points the closer to the target the participant clicks. I've managed to build the basic skeleton, but just stuck with mismatched response units. Any helps is greatly appreciated.The stimulus element's (here: <picture>) xpx property gives you the horizontal pixel coordinate, the ypx gives you the vertical pixel coordinate.https://www.millisecond.com/support/docs/current/html/language/properties/xpx.htmhttps://www.millisecond.com/support/docs/current/html/language/properties/ypx.htm
+x MattJohnson - 6/20/2024Hi, just wondering if there is a way to change responsex and responsey from pixels to percentages? If not, is there a way to change picture.position to pixels if you're using a values attributes as x and y values? I'm trying to build a task where participants click on a target (or close to it). The target will be masked and change location on each trial. Participants will then receive points based on how close their response is to the target; more points the closer to the target the participant clicks. I've managed to build the basic skeleton, but just stuck with mismatched response units. Any helps is greatly appreciated.