2008/06/19

Dynamic Texts



In the 'Text' type primitive, the text is specified by the 'Text' field. It can contain two special syntax for dynamic changing texts between frames.

comma separated texts
if the text has multiple parts separated by comma( , ), for example "A,B,C", the A and B and C will be assigned between frames.

ex) "Sin,Tri,Sqr,Saw,Noise"

contiguous numbers
if the text has following format, it will be expand to the sequence of the numbers.

(FromNumber:ToNumber[:StepNumber] [:FormatString])

third and forth parameters can be omitted. the most simple form is (1:100). if add the step number, it will be (1:100:10), or add formatstrig (1:100:%03d). if all parameter used (1:100:10:%03d).

for example, the default text of the text primitive is (1:99), it will be expand to "1,2,3,4,......98,99". if the last value is less than the first value, the sequence will be decremental. in addition, the first or last value can be negatve.

if you need detail formatting, the C-like format string can be added. for example "(0:99:%02d)",

format string:
format string can be following form

%[+][0][width][.precision]type

+ add '+' sign if the value is positive (optional)
0padding by '0' (optional)
widthminimum number of output width (optional)
.precision the number of the decimal portion digits. used for the 'f' type(optional)
type c a character by ascii code
dsigned decimal
xhexadecimal lower case
Xhexadecimal upper case
ffloating point

format string examples

In almost case, 'f' type is used with a fraction number step. ex) "0:1:0.1:%.1f" will be expanded to 0.0 to 1.0 with 0.1 step : 0.0,0.1,0.2,0.3...1.0

If no format string is specified, it is equivalent to "%d".

combination
comma separated texts and contiguous numbers can be used in the combinaton. following is a 'Pan Control' sample.

L(50:1),<C>,R(1:50)

it will be expand to

L50,L49,...L2,L1,<C>,R1,R2,...R49,R50


Return
g200kg