Page 1 of 1

printf

PostPosted: Sat Jul 09, 2005 5:33 pm
by Just4Fun
Could someone steer me toward the proper Script Editor syntax for this statement:

printf ("Hello %s", "World");

Thank you...

PostPosted: Sun Jul 10, 2005 2:26 pm
by makslane
There is no support for printf in Game Editor.
You can use sprintf to put the text in some actor text:

sprintf(youractor.text, "Hello %s", stringvar);

Use sprintf to mix fixed text (like "Hello...") with text in variables (like actor name, numbers, ...)

More info about sprintf:
http://www.cplusplus.com/ref/cstdio/sprintf.html

PostPosted: Tue Jul 12, 2005 6:20 am
by Just4Fun
Opps! Sorry.

I misread the variables/functions menu... :oops:

but, thank you for the sprintf example! :wink: