Dynamic text changes size of background


I have a simple lower third with a dynamic textfield created in Flash. Often the text is longer than my background.
How can the lenght of the dynamic text (input from caspar client) adjust the size of background horizontaly to the right?
Dynamic-text-length.jpg (49.84 KiB) Viewed 366 times

Re: Dynamic text changes size of background

Sure I have an idea, it's easy. Do you know how to do "Advanced Templates"? http://casparcg.com/wiki/Content_/_Medi ... _Templates

Make the Textfield as small as possible, so that only a single I has room to be shown.
Then set the autosize:

Code: Select all

nameOfDynamicTextField.autoSize = TextFieldAutoSize.LEFT;
In the SetData() override function you get the text out of the xml and set it into the field like so:

Code: Select all

nameOfDynamicTextField.text = element.data.@value;
Then you can get the width of the textfield to set the size of your rectangle.
Didi Kunz
CasparCG Client-Programmer, Template Maker & Live CG-Operator
Media Support, CH-5722 Gränichen, Switzerland http://mediasupport.ch/
Problems? Guide to posting Bug reports & Feature requests

Who is online

Users browsing this forum: No registered users and 2 guests