Number one:
Is there a way to determine the font or the lines in a text when you use the strcpy() function?
Number two:
I forgot how to limit the maximum char number of a textbox.
Thanks.
==Kalladdolf== wrote:Number one:
Is there a way to determine the font or the lines in a text when you use the strcpy() function?
feral wrote:try \n in the string for newline.
feral wrote:I assume you want to STOP the amount of text that can be input ?
if (strlen(text)>20) // if string length is greater then max lenght (not incluiding null characters)
{
strncpy(text2.text,text,20);
// string N copy (strncpy) max amount to temp holding string
// in this case another text actor - could easily be an ordinary string.
// strncpy copies upto the number of characters specified
// see ge script reference
strcpy(text,"");
// empty the curent textbox (all characters inlcuding extras)
// by copying empty string.
strcpy(text,text2.text);
// copy temp holding string back into textbox
strcat(text," ");
// add a space at the end of text box
// note: this is a GE thing - otherwise the textbox closes in
// (ie: only needed to stop textbox becoming smaller then string)
}
Fuzzy wrote:You dont need to check the length. Just do it every draw. You also should not need to empty the text.
Users browsing this forum: No registered users and 1 guest