Dynamic text changes size of background

#1
Hi

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?
Attachments
Dynamic-text-length.jpg
Dynamic-text-length.jpg (49.84 KiB) Viewed 1323 times

Re: Dynamic text changes size of background

#3
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

Re: Dynamic text changes size of background

#6
gas75 wrote: Hi all, I was looking for the exact opposite: Change the size of a shape that acts as a background of a text field. How can this be achieved? Any help would be appreciated!
note: i'm using the default CasparCG client 2.0.9 (if that matters)
That's exactly what we are talking about in this tread. When you know the lenght of the text, you can size the rectange or shape based on it.
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