sprintf
Posted: Thu Feb 23, 2006 7:31 pm
I'm trying to make an onscreen keyboard (to use instead of the SIP) and I think I need to use sprintf but can't figure out how to get it to work.
When the text actor that displays the name is created, I have the following pseudocode in create actor -> script editor:
stringvar = "";
Then, when you press the stylus down on a letter, say "q" for example, the following code is executed:
sprintf(stringvar, TextActor.text); //set stringvar = already typed letters
sprintf(TextActor.text, "q", stringvar); // concatenate stringvar and "q" and display the result in TextActor.text
When I add similar code to other letters, I can get TextActor to display the letter most recently typed, but cannot get it to add any letters (i.e., TextActor only displays one character...the most recently typed one).
I'm sure this is just me not knowing how to use sprintf.
Help is much appreciated!
When the text actor that displays the name is created, I have the following pseudocode in create actor -> script editor:
stringvar = "";
Then, when you press the stylus down on a letter, say "q" for example, the following code is executed:
sprintf(stringvar, TextActor.text); //set stringvar = already typed letters
sprintf(TextActor.text, "q", stringvar); // concatenate stringvar and "q" and display the result in TextActor.text
When I add similar code to other letters, I can get TextActor to display the letter most recently typed, but cannot get it to add any letters (i.e., TextActor only displays one character...the most recently typed one).
I'm sure this is just me not knowing how to use sprintf.
Help is much appreciated!