Please Fill In the Blank- App Dev Series 3

Quick guide of let system can receive data from input field of UI.

While creating interactive app interface, fill in some needed information is quite common. In this quick guide, we will make the system can identify the information that user input in Input Field of Unity UI.

Input Field

To input something in Unity, you need an UI element called Input Field.

When adding an Input Field in Unity, you would need to take a further setting on input size and align.
To adjust this part, you have to run Play mode and adjust the size or align, then copy the value of component and paste it back when disable Play mode.

Unity would not display the input text under edit mode.

Once finished adjusting the Input Field, we can make the script to read this.

Get the text from field

In this example, I would make a script for this panel, and receive the data from UIManager and rewrite the name data with Input Field.
When press “Next” button, the system would receive data of user name from the column and record it in database.

In the script of this panel, set the reference of these 2 Input Field.

Don’t forget to enable the library of UI.

Then create a method for the button to send name info to system.
In this method, first let’s get the string data.

Then create an if statement to check if user actually input the data before click “Next”.

We can make a method to UIManager to receive this data.

All done! Once you Play it and test it with data inputed, you should see the result in Inspector.

--

--

--

A passionate gamer whose goal is to work in video game development.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Interactive Audiovisual Music Sequencer Part I: Rough Sketching

CS371p Fall 2020: Nathan Gates Week 3

How to Design a Scalable Serverless Application on AWS?

49 Ways to Leave Your eImpact

SunCoin Masternode Setup — MacOs

Web Scraping Using VBA

Stader brings Degen Vaults to Terra 2.0 — Introducing Dollar Cost Averaging (DCA)

🧐 Interesting about us We want to know each other better so let’s talk about us and in reply we…

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
S.J. Jason Liu

S.J. Jason Liu

A passionate gamer whose goal is to work in video game development.

More from Medium

2D Mobile: Designing Enemies Using Abstract Classes

Learning Unity — How To Make A Loading Screen

Creating the Main Menu

Tap & Hold & Rapid Prototyping w/ New Unity Input System