Millisecond Forums

Wrapping Text

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

By CES - 6/24/2014

Hello, I am trying to place multiple paragraphs of text on one page. Is there anyway to wrap the text so that it goes to the next line without manually having to do it. Because there are multiple text objects on that page, it would be more uniform if the program wrapped it
By Dave - 6/24/2014

#1: You absolutely *must* specify the respective <text> elements' /size attributes of you want text to wrap.

#2: You can at any time insert manual line breaks and the like by using properly escaped "special characters" (cf. the "special characters" topic in the documentation.

<text mytext>
/ items = ("This is a ~nnew line")
/ size = (50%, 20%)
...
<text>
By CES - 6/24/2014

I am using the size attribute to wrap the text, but it's proving difficult to get an equal space between paragraphs. Is there a way to do this?
By Dave - 6/24/2014

Please clarify what exactly "it's proving difficult to get an equal space between paragraphs" means and how you are going about this.
By CES - 6/25/2014

I was referring to putting each paragraph in as individual text stimuli. So perhaps being able to do text.name.height +10% for the vposition of the next paragraph. I was able to solve the problem by combining the paragraphs into one text stimuli. Thank you
By Dave - 6/25/2014

Ah -- thanks for the clarification. Yes, combining them into a single <text> element is the most straightforward solution in most cases. Otherwise, you absolutely *can* position elements relative to each other according to their size and position:

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

<text a>
/ items = ("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.")
/ size = (40%, 20%)
/ position = (50%, 10%)
/ txbgcolor = (red)
/ hjustify = left
/ vjustify = center
/ halign = center
/ valign = top
</text>

<text b>
/ items = ("Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.")
/ size = (40%, 20%)
/ position = (50%, text.a.vposition+text.a.height)
/ txbgcolor = (green)
/ hjustify = left
/ vjustify = center
/ halign = center
/ valign = top
</text>

<text c>
/ items = ("Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.")
/ size = (40%, 20%)
/ position = (50%, text.b.vposition+text.b.height)
/ txbgcolor = (blue)
/ hjustify = left
/ vjustify = center
/ halign = center
/ valign = top
</text>

<text d>
/ items = ("Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.")
/ size = (40%, 20%)
/ position = (50%, text.c.vposition+text.c.height)
/ txbgcolor = (yellow)
/ hjustify = left
/ vjustify = center
/ halign = center
/ valign = top
</text>
By CES - 6/25/2014

Ah I see. Thank you so much.