﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Millisecond Forums » Millisecond Forums » Inquisit 6  » Change responsex and responsey from pixels to percentage</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Thu, 30 Apr 2026 12:24:40 GMT</lastBuildDate><ttl>20</ttl><item><title>Change responsex and responsey from pixels to percentage</title><link>https://forums.millisecond.com/Topic36305.aspx</link><description>Hi, 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&amp;nbsp;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.</description><pubDate>Fri, 21 Jun 2024 09:12:17 GMT</pubDate><dc:creator>MattJohnson</dc:creator></item><item><title>RE: Change responsex and responsey from pixels to percentage</title><link>https://forums.millisecond.com/Topic36320.aspx</link><description>&lt;blockquote data-id="36308" class="if-quote-wrapper" unselectable="on" data-guid="1718961072194" contenteditable="false" id="if_insertedNode_1718961071258"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="36308" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="36308" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="36308" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 6/20/2024&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-36308"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="36307" class="if-quote-wrapper" unselectable="on" data-guid="1718961072194" contenteditable="false" id="if_insertedNode_1718901693691"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="36307" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="36307" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="36307" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 6/20/2024&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-36307"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="36305" class="if-quote-wrapper" unselectable="on" data-guid="1718961072194" contenteditable="false" id="if_insertedNode_1718898152634"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="36305" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="36305" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="36305" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;MattJohnson - 6/20/2024&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-36305"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;Hi, 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&amp;nbsp;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.&lt;a class="if-quote-goto quote-link" href="#" data-id="36305"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;The stimulus element's (here: &amp;lt;picture&amp;gt;) xpx property gives you the horizontal pixel coordinate, the ypx gives you the vertical pixel coordinate.&lt;br/&gt;&lt;br/&gt;&lt;a href="https://www.millisecond.com/support/docs/current/html/language/properties/xpx.htm"&gt;&lt;a href="https://www.millisecond.com/support/docs/current/html/language/properties/xpx.htm"&gt;https://www.millisecond.com/support/docs/current/html/language/properties/xpx.htm&lt;/a&gt;&lt;/a&gt;&lt;br/&gt;&lt;a href="https://www.millisecond.com/support/docs/current/html/language/properties/ypx.htm"&gt;&lt;a href="https://www.millisecond.com/support/docs/current/html/language/properties/ypx.htm"&gt;https://www.millisecond.com/support/docs/current/html/language/properties/ypx.htm&lt;/a&gt;&lt;/a&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="36307"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Here's a quick and dirty example:&lt;br/&gt;&lt;br/&gt;[code]&amp;lt;values&amp;gt;&lt;br/&gt;/ targetx = 0&lt;br/&gt;/ targety = 0&lt;br/&gt;/ targetxpx = 0&lt;br/&gt;/ targetypx = 0&lt;br/&gt;/ points = 0&lt;br/&gt;/ totalPoints = 0&lt;br/&gt;/ responsex = 0&lt;br/&gt;/ responsey = 0&lt;br/&gt;/ distancepx = 0&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block myblock&amp;gt;&lt;br/&gt;/ trials = [1-10 = trial.mytrial]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial mytrial&amp;gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.targetx = floor(randgaussian(50,20));&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.targety = floor(randgaussian(50,20));&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;]&lt;br/&gt;/ ontrialend = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.targetxpx = picture.cir.xpx;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.targetypx = picture.cir.ypx;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.responsex = trial.mytrial.responsex;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.responsey = trial.mytrial.responsey;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.distancepx = sqrt(pow((values.responsex - values.targetxpx), 2) + pow((values.responsey - values.targetypx), 2));&lt;br/&gt;]&lt;br/&gt;/ stimulustimes = [0 = fixation; 800 = clearscreen; 850 = cir]&lt;br/&gt;/ inputdevice = mouse&lt;br/&gt;/ validresponse = (lbuttondblclk)&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;item cir_file&amp;gt;&lt;br/&gt;/ 1 = "cir.png"&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;picture cir&amp;gt;&lt;br/&gt;/ items = cir_file&lt;br/&gt;/ size = (10%, 10%)&lt;br/&gt;/ position = (values.targetx, values.targety)&lt;br/&gt;&amp;lt;/picture&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text fixation&amp;gt;&lt;br/&gt;/ items = ("+")&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;data&amp;gt;&lt;br/&gt;/ columns = (trialnum values.targetx values.targety values.targetxpx values.targetypx values.responsex values.responsey values.distancepx)&lt;br/&gt;&amp;lt;/data&amp;gt;&lt;br/&gt;[/code]&lt;a class="if-quote-goto quote-link" href="#" data-id="36308"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Fantastic! Thank you very much, Dave- much appreciated!</description><pubDate>Fri, 21 Jun 2024 09:12:17 GMT</pubDate><dc:creator>MattJohnson</dc:creator></item><item><title>RE: Change responsex and responsey from pixels to percentage</title><link>https://forums.millisecond.com/Topic36308.aspx</link><description>&lt;blockquote data-id="36307" class="if-quote-wrapper" unselectable="on" data-guid="1718901694277" contenteditable="false" id="if_insertedNode_1718901693691"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="36307" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="36307" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="36307" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 6/20/2024&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-36307"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="36305" class="if-quote-wrapper" unselectable="on" data-guid="1718901694277" contenteditable="false" id="if_insertedNode_1718898152634"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="36305" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="36305" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="36305" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;MattJohnson - 6/20/2024&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-36305"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;Hi, 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&amp;nbsp;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.&lt;a class="if-quote-goto quote-link" href="#" data-id="36305"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;The stimulus element's (here: &amp;lt;picture&amp;gt;) xpx property gives you the horizontal pixel coordinate, the ypx gives you the vertical pixel coordinate.&lt;br/&gt;&lt;br/&gt;&lt;a href="https://www.millisecond.com/support/docs/current/html/language/properties/xpx.htm"&gt;&lt;a href="https://www.millisecond.com/support/docs/current/html/language/properties/xpx.htm"&gt;https://www.millisecond.com/support/docs/current/html/language/properties/xpx.htm&lt;/a&gt;&lt;/a&gt;&lt;br/&gt;&lt;a href="https://www.millisecond.com/support/docs/current/html/language/properties/ypx.htm"&gt;&lt;a href="https://www.millisecond.com/support/docs/current/html/language/properties/ypx.htm"&gt;https://www.millisecond.com/support/docs/current/html/language/properties/ypx.htm&lt;/a&gt;&lt;/a&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="36307"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Here's a quick and dirty example:&lt;br/&gt;&lt;br/&gt;[code]&amp;lt;values&amp;gt;&lt;br/&gt;/ targetx = 0&lt;br/&gt;/ targety = 0&lt;br/&gt;/ targetxpx = 0&lt;br/&gt;/ targetypx = 0&lt;br/&gt;/ points = 0&lt;br/&gt;/ totalPoints = 0&lt;br/&gt;/ responsex = 0&lt;br/&gt;/ responsey = 0&lt;br/&gt;/ distancepx = 0&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block myblock&amp;gt;&lt;br/&gt;/ trials = [1-10 = trial.mytrial]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial mytrial&amp;gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.targetx = floor(randgaussian(50,20));&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.targety = floor(randgaussian(50,20));&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;]&lt;br/&gt;/ ontrialend = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.targetxpx = picture.cir.xpx;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.targetypx = picture.cir.ypx;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.responsex = trial.mytrial.responsex;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.responsey = trial.mytrial.responsey;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.distancepx = sqrt(pow((values.responsex - values.targetxpx), 2) + pow((values.responsey - values.targetypx), 2));&lt;br/&gt;]&lt;br/&gt;/ stimulustimes = [0 = fixation; 800 = clearscreen; 850 = cir]&lt;br/&gt;/ inputdevice = mouse&lt;br/&gt;/ validresponse = (lbuttondblclk)&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;item cir_file&amp;gt;&lt;br/&gt;/ 1 = "cir.png"&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;picture cir&amp;gt;&lt;br/&gt;/ items = cir_file&lt;br/&gt;/ size = (10%, 10%)&lt;br/&gt;/ position = (values.targetx, values.targety)&lt;br/&gt;&amp;lt;/picture&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text fixation&amp;gt;&lt;br/&gt;/ items = ("+")&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;data&amp;gt;&lt;br/&gt;/ columns = (trialnum values.targetx values.targety values.targetxpx values.targetypx values.responsex values.responsey values.distancepx)&lt;br/&gt;&amp;lt;/data&amp;gt;&lt;br/&gt;[/code]</description><pubDate>Thu, 20 Jun 2024 16:42:20 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Change responsex and responsey from pixels to percentage</title><link>https://forums.millisecond.com/Topic36307.aspx</link><description>&lt;blockquote data-id="36305" class="if-quote-wrapper" unselectable="on" data-guid="1718898153543" contenteditable="false" id="if_insertedNode_1718898152634"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="36305" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="36305" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="36305" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;MattJohnson - 6/20/2024&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-36305"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;Hi, 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&amp;nbsp;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.&lt;a class="if-quote-goto quote-link" href="#" data-id="36305"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;The stimulus element's (here: &amp;lt;picture&amp;gt;) xpx property gives you the horizontal pixel coordinate, the ypx gives you the vertical pixel coordinate.&lt;br/&gt;&lt;br/&gt;&lt;a href="https://www.millisecond.com/support/docs/current/html/language/properties/xpx.htm"&gt;https://www.millisecond.com/support/docs/current/html/language/properties/xpx.htm&lt;/a&gt;&lt;br/&gt;&lt;a href="https://www.millisecond.com/support/docs/current/html/language/properties/ypx.htm"&gt;https://www.millisecond.com/support/docs/current/html/language/properties/ypx.htm&lt;/a&gt;&lt;br/&gt;</description><pubDate>Thu, 20 Jun 2024 16:08:08 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>