# number entry field for game

**URL:** https://discussions.unity.com/t/number-entry-field-for-game/126498
**Category:** Questions & Answers
**Created:** [December 31, 2014, 5:28am UTC](https://discussions.unity.com/t/number-entry-field-for-game/126498 "2014-12-31T05:28:22Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ks9109](https://avatars.discourse-cdn.com/v4/letter/k/f9ae1b/32.png) [@ks9109](https://discussions.unity.com/u/ks9109)
#### Post date: [December 31, 2014, 5:28am UTC](https://discussions.unity.com/t/number-entry-field-for-game/126498/1 "2014-12-31T05:28:22Z")

</div>

my game is based off number entry and guessing i just wanted to know if i can use the same system.print procedure i saw in javasript tutorials and how would i use that type of GUI for my game anyhelp would help other than google help i need unity help lol

---

<div class="post-metadata">

### Author: ![Landern](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/landern/32/170836_2.png) [@Landern](https://discussions.unity.com/u/Landern)
#### Post date: [December 31, 2014, 5:32am UTC](https://discussions.unity.com/t/number-entry-field-for-game/126498/2 "2014-12-31T05:32:01Z")

</div>

In unity, you don’t actually use JavaScript as in ecmascript, but is commonly referred to as javascript and some times UnityScript since it’s an amalgamation of syntax that javascript looking and some other special spices.

What you’re, and i’m assuming, referring to is system.out.print form Java. The answer is nope, sorry wrong language, but Unity does have it’s own UI system, particurally rewritten in version 4.6+ to give some nice power to the designer/coder.

I would take a moment and review the tutorials about the new UI system and if your not using 4.6, give it a look(you can install multiple version side by side if you change the installation folder/directory).

[UI Tutorials](http://unity3d.com/learn/tutorials/modules/beginner/ui)

---

<div class="post-metadata">

### Author: ![Qasem2014](https://avatars.discourse-cdn.com/v4/letter/q/a183cd/32.png) [@Qasem2014](https://discussions.unity.com/u/Qasem2014)
#### Post date: [January 2, 2015, 10:17am UTC](https://discussions.unity.com/t/number-entry-field-for-game/126498/3 "2015-01-02T10:17:01Z")

</div>

_Here is the code that i use before :_

```
var stringToEdit : String[];

function Start()
{
	stringToEdit = new String[1];
	for (var i = 0; i < stringToEdit.Length; i++)
	{ stringToEdit *= String.Empty; }*

```

_}_  
_// Read From Input_  
_function OnGUI()_  
_{_

- GUI.BeginGroup (new Rect(SW/16,10,SW/4,SH/10));\*
- 

```
 for (var i = 0; i < stringToEdit.Length; i++)*

```

- 

```
 {*

```

\_ stringToEdit _= GUILayout.TextField_\_  
_\_ (stringToEdit\*, 10, GUILayout.Width(SW/4),  
  GUILayout.Width(SW/4),  
  GUILayout.Height(SH/10));  
  }  
  GUI.EndGroup();  
 }  
 // Write input to a variable - call this function when press a button\*  
 function Refister()  
 {  
 \* var NameString: String;  
  for (var i = 0; i \< stringToEdit.length; i++)  
  { NameString = NameString + stringToEdit.ToString(); }  
 }\*  
 **\<\< check it , maybe have errors \>\>** \__
