Relative Item Positioning?


Author
Message
Marcel
Marcel
Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)
Group: Forum Members
Posts: 9, Visits: 121
Hi,

I was wondering whether a method exists to position items relative to other items?

Failing that, what would be best practice to position items in one and two dimensions such that items are equidistant or spaced by a fixed amount? 

In the example below the gap between items increases with the length of the item. Is there a way to access the greatest value of the x coordinate and then just add a fixed value for the spacing? Or a general formula for converting the length of the item into px? 

<defaults>
/inputdevice = mouse
</defaults>

<values>
/currentX = 100
/yPosString = "300px"
/xPosString = ""
</values>

<list firstWord>
/items = ("Short", "Longer", "MuchLonger")
/ selectionmode = sequence
</list>

<list secondWord>
/items = ("Short", "Longer", "MuchLonger")
/selectionmode = sequence
</list>

<list thirdWord>
/items = ("thirdWord")
/selectionmode = sequence
</list>


<text partA>
/onprepare = [   values.xposstring = concat(values.currentx, "px")]
/items = ("<%list.firstWord.nextvalue%>")
/position = (values.xposstring, values.yposstring)
</text>

<text partB>
/onprepare = [   values.currentX += (15 * length(text.parta.currentitem)) ;
            values.xposstring = concat(values.currentX, "px")]
/items = ("<%list.secondWord.nextvalue%>")
/position = (values.xposstring, values.yposstring)
</text>

<text partC>
/onprepare = [   values.currentX += (15 * length(text.partb.currentitem)) ;
            values.xposstring = concat(values.currentX, "px")]
/items = ("<%list.thirdWord.nextvalue%>")
/position = (values.xposstring, values.yposstring)
</text>

<trial q1>
/stimulusframes = [1=partA, partB]
/validresponse = (partA, partB)
/ontrialend = [values.currentx = 100]
</trial>

<trial q2>
/stimulusframes = [1=partA, partB, partC]
/validresponse = (partA, partB, partC)
/ontrialend = [values.currentx = 100]
</trial>

<block test>
/ trials = [1-3=q1; 4-6=q2]
</block> 


Thanks


Marcel

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