Millisecond Forums

Box surrounding a word

https://forums.millisecond.com/Topic13902.aspx

By Ali - 8/1/2014

Hello. I'm trying to draw a box. I need it to be either transparent or just borders--so that it does not hide words behind/in it. 

The documentation says the shape element can be used "for drawing background to be presented behind other stimuli." But I did find how. It keeps covering other stimuli. Any help? Thanks! 

Best, 

Ali

By Dave - 8/1/2014

See e.g. https://www.millisecond.com/forums/Topic3223.aspx (applies to <text> elements as well).
By Ali - 8/1/2014

Hello Dave. Thanks for the tip. 
I tried it but the result turned out aesthetically unappealing (see attached screenshot, right box). So I came up with a 'low-tech' way to design a box (see .iqx attached). I wonder if there is a more high-tech way to prepare this type of  square more efficient. 
By Dave - 8/1/2014

What you need to do is define proper /size, /position, /txbgcolor etc. for the <text> elements in the foreground. Then a single, simple rectangular <shape> in the background is enough. Example:

<text a>
/ items = ("Foo Bar Baz")
/ txcolor = (white)
/ txbgcolor = (black)
/ size = (25%, 0.25px*display.width)
/ position = (50%, 50%)
/ vjustify = top
</text>

<text b>
/ items = ("Foo")
/ txcolor = (white)
/ txbgcolor = (transparent)
/ size = (25%, 0.25px*display.width)
/ position = (50%, 50%)
/ vjustify = center
</text>

<text c>
/ items = ("Foo Bar Baz")
/ txcolor = (white)
/ txbgcolor = (transparent)
/ position = (50%, 50%)
/ size = (25%, 0.25px*display.width)
/ position = (50%, 50%)
/ vjustify = bottom
</text>

<shape bg>
/ color = (blue)
/ size = (26%, 0.26px*display.width)
/ position = (50%, 50%)
</shape>

<trial mytrial>
/ stimulusframes = [1=bg,a,b,c]
/validresponse = (57)
</trial>

By Ali - 8/1/2014

Exactly what I needed! Thanks!