Put your text in a rectangle

Put your text in a rectangle

Set a simple but responsive background to a text.

1) Create a Rectangle A rectangle Read More and a Text Generator A simple but very powerful text Read More in your Element Tree The hierarchical structure of Smode elements Read More
The main idea is to make a connection between the size of the box and the size of the text thanks some Link A link from a source parameter to a set of Link Target Read More .
There is 2 way to do that:
  • 1) The size of the rectangle depends of the size of the text
  • 2) The size of the text depends of the size of the rectangle

Method1: The rectangle depends of the text

1) Right click over the size parameter of the Text renderer Render a Text or group of text Read More and create a Link A link from a source parameter to a set of Link Target Read More from the widht and the height

2) Drag and drop the width and the height parameters of the rectangle in the empty Link Target Represent a link or parameter. Point toward an element parameter. "right click -> Goto" on the target to go to that element Read More
3) Right click on each Link Target Represent a link or parameter. Point toward an element parameter. "right click -> Goto" on the target to go to that element Read More and add a Divide Divide the Input value Read More for the height and the width. Set the divide value equals to the width resolution of your compo for the width. Do the same for the height. If your compo is 1920x1080, the Divide Divide the Input value Read More should have a divide value to 1920 for witdh.
4) Select the Rectangle A rectangle Read More , uncheck the scale->Linked paramters and link it's placement to the Text.
5) In order to create some margin, go to the Link Target Represent a link or parameter. Point toward an element parameter. "right click -> Goto" on the target to go to that element Read More and add a Offset Offset the input value with a simple - or + operator Read More

Method2: The text depends of the rectangle

Bit the same as the first method.
1) To be more intuitive, it's better to start this method with an anchor point for the text and rectangle at 0,0.
2) Create Link A link from a source parameter to a set of Link Target Read More from the width and the height placemenet paramters of the Rectangle A rectangle Read More
3) Select your Text Generator A simple but very powerful text Read More and in it's Text renderer Render a Text or group of text Read More , switch the width parameters from "auto" to "Word Wrap", such as its Height parameters from auto to clamp.

4) then, right click on the width and height parameter of the text and connec to -> width or Height
5) Go to the placement options and link your text to the rectangle.
With some Shape Modifier Modify a list of shapes Read More , you should get some result like this:

See Also: