Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: curzon on October 16, 2012, 12:03:56 PM

Title: Verry simple question about basic inputfield
Post by: curzon on October 16, 2012, 12:03:56 PM
Hi folks, got a NGUI professional version and working through the tutorials right now. First of all: its a VERRY good Framework that is easy to use.

I'm trying now to script around with NGUI, but i just can't find the answer to my question:

I have created a UI named "LoginGui"...
this UI (LoginGui->Camera->Anchor->Panel->....) have got 2 Inputfields named "InputAccount" and "InputPassword" and 1 Button...
a button got a OnClick() function and I want to get the variables of these 2 Input fields (in JavaScript) by pressing the button.

How can I do this? A simple code snippet would be nice how to access this variables of the Imputfields...
Thank you very much in advance for your answer
Title: Re: Verry simple question about basic inputfield
Post by: ArenMook on October 16, 2012, 01:15:58 PM
1. Create public variables on your button script -- inputUsername, inputPassword.
2. Attach this script to your button
3. Drag & drop the inputs into these fields in the inspector
4. Add an OnClick() function to this script that will do something. You can retrieve values by using inputUsername.text, etc.