Millisecond Forums

Why isn't my text being presented at the center of the screen?

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

By Shona - 5/26/2014

Hi, 

I would like my text stimuli to be presented at the center of the screen, both vertically and horizontally. My script for this text is pasted below. Why isn't it being presented at the center of the screen? (It is being displayed at the top center--so it is centered horizontally but not vertically). 

I'd be very grateful for your insight. 

Shona

<text Political_item>
/size = (75%, 75%)
/items = Political_item
/position = (50%, 50%)
/valign = center
/halign = center
/select = noreplacenorepeat
/selectionrate = always
</text>
By Dave - 5/26/2014

The <text> element *is* centered as you could easily see by giving it a visible /txbgcolor:

<text Political_item>
/ txbgcolor = (red)
/size = (75%, 75%)
/items = Political_item
/position = (50%, 50%)
/valign = center
/halign = center
/select = noreplacenorepeat
/selectionrate = always
</text>

What isn't centered vertically is the item text inside the bounding rectangle defined by the /size. Observe the difference when defining

<text Political_item>
/ txbgcolor = (red)
/size = (75%, 75%)
/items = Political_item
/position = (50%, 50%)
/ hjustify = center
/ vjustify = center
/valign = center
/halign = center
/select = noreplacenorepeat
/selectionrate = always
</text>

all of which you can find documented in the language reference for the <text> element.