Page 1 of 1

Make the limit text for Text Input?

PostPosted: Fri May 13, 2011 2:29 am
by Wertyboy
Example: Player can only type 5 words,...
is it hard?

Re: Make the limit text for Text Input?

PostPosted: Fri May 13, 2011 3:01 am
by skydereign
No it's not too hard, although it is easier to limit the number of characters they can type. If you want to limit the number of characters a text actor has, just do this.
text -> Draw Actor -> Script Editor
Code: Select all
char buffer[11];
strncpy(buffer, text, 10)
strcpy(text, buffer);


Changing the numbers in that will change how many characters are allowed. If you want to do actual words, you'd have to search the array for spaces in the array to know when to limit it. Does the above method work for whatever it is you are doing? Or would you like to limit by number of words?

Re: Make the limit text for Text Input?

PostPosted: Fri May 13, 2011 3:42 am
by Wertyboy
thx!! 1+ point for you