Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: harrisonpink on April 03, 2015, 12:27:04 AM

Title: choose between regular mobile keyboard and numeric pad?
Post by: harrisonpink on April 03, 2015, 12:27:04 AM
Hi all,

I would love to be able to choose when the user clicks a text field between having the normal mobile keyboard pop up and the numeric keyboard. I know Unity has TouchScreenKeyboardType.NumberPad, but I know NGUI is using its own UIInput script.

Any help to get this working would be very appreciated!

Thanks.
Title: Re: choose between regular mobile keyboard and numeric pad?
Post by: ArenMook on April 04, 2015, 04:08:23 AM
UIInput.keyboardType lets you specify what kind of keyboard it will be.
Title: Re: choose between regular mobile keyboard and numeric pad?
Post by: harrisonpink on April 05, 2015, 02:31:42 AM
Thank you for the info! I'm not sure where to actually execute this code though. Right now, when you tap a text box that accepts input, it automatically pops open the keyboard. Where should I add the code that specifies what type of keyboard it should be?

(Teaching myself programming is hard! Thank you for your assistance!)
Title: Re: choose between regular mobile keyboard and numeric pad?
Post by: ArenMook on April 06, 2015, 07:42:59 AM
It's set in inspector on the UIInput when you are targeting a mobile platform.
Title: Re: choose between regular mobile keyboard and numeric pad?
Post by: harrisonpink on April 09, 2015, 12:24:15 PM
Is this something I can change on the fly? I'm making a quiz app and some questions are words and some are numbers.
Title: Re: choose between regular mobile keyboard and numeric pad?
Post by: ArenMook on April 09, 2015, 04:01:05 PM
Yes. GetComponent<UIInput>().keyboardType = ...