Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: Disastercake on February 16, 2013, 11:14:52 PM
-
I've been putting this off for a while, but I can't seem to find a way to do input validation when typing in text. For example, what if I only want the player to be able to type 10 characters for a name? or only A-Z characters (no numbers, or special character). I was expecting NGUI to have a native solution to this, but can't find it.
What is the proper way to handle this type of validation?
-
Can't find it? Serious?
UIInput.maxChars (http://www.tasharen.com/ngui/docs/class_u_i_input.html#a8fa80c3cfe8ecbc79f6f50e0b9457465)
UIInput.validator (http://www.tasharen.com/ngui/docs/class_u_i_input.html#aaeee199d0fb1212639e1859f821f676e)
-
I guess I was focusing on the label component, and not the parent. Silly me. Thanks for the links.
There's almost no documentation on UIInput.validation, though. I would say that it's a good idea to state in the doc notes that it's a component of it's own that you are required to add.
-
Take a look inside UIInputValidator.