I’m trying to do this using a textArea and converting the int to a string, limiting the lenght of the string to 3, but the text it’s getting uneditable… How can I do this?
I want to do something like this:
And I want to pop up the number keyboard on android when user touch the number area. I saw on the support that it’s automatic but i didn’t see how to open the number keyboard.
Ok, your problem is that you’re not setting numeroDoHino to the new value - it always stays the same, so the textfield appears uneditable. To fix it, you’ll have to parse the textfield for an int value and set numeroDoHino to that.
Typed in browser, may not execute:
function OnGUI(){
var textValue = GUI.TextField(Rect(0,0,100,40),numeroDoHino.ToString(),3)
if(Int32.TryParse(textValue, numeroDoHino)) Debug.Log("Success!");
}
Thanks man! It worked perfectly! I just needed to switch Int32 to int because I’m using js.
And about the mobile keyboard, it’ll open the number keyboard automatic, or the user will need to navigate trhough the normal keyboard to type number?