Older Newer
Mon, 02 Aug 2021 03:40:22 . . . . SyneRyder [Add return value, improve description, parameters and example]


Changes by last author:

Added:
= setCtlTextv =

== Syntax ==

bool setCtlTextv(int ctlnum, string textv, ...)

== Arguments ==

:ctlnum

::The number of the control whose text you'd like to change.

:textv

::A string containing the formatted text you'd like the label text changed to.

:...

::Additional variables to substitute for the formatting symbols in textv

== Return ==

Returns false/zero if the text couldn't be set, true/non-zero otherwise.

== Description ==

Sets the text label for user control (with index number ctlnum) to the expanded printf-style formatted string. Note that not all user controls support text strings. Also keep in mind that the user control has to be resized if your text string exceeds the current size. Substrings and escape sequences are allowed.

== Example ==

<code>

%ffp

ctl(10): STATICTEXT, pos=(*,60),fontcolor=red,size=(150,*)

ForEveryTile:{

const int startclock = clock();

int endclock;

for (y=y_start; y<y_end; y++) {

for (x=x_start; x<x_end; x++) {

// Effect code goes here

}}

endclock = clock() - startclock;

setCtlTextv(10, "Render time needed: %d %s", endclock, "ms");

return true;

}

</code>

== See Also ==

setCtlText

== Comments ==

Everyone can add his comments about his experiences with this function here. Tips for using it are welcome, too.