number entry field for game

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

you want show a variable on screen right ? whats your unity version ?

–

4.6 but i dont only want to show variable i wanna beable to enter through keyboard on phone

–

2 Answers

2

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

It didnt exactly teach me what i needed to know i need to make a number entry game like how they have those text entry apps for trivia apps and such but thank you i didnt know they had so many tools.

–

Thank you but i checked into it and i could not find what i was looking for as far as 000 as the random number generates how would i make it so i can enter a number in the --- field where you would touch it and enter the number i only wish to use unity because of the back drop looks otherwise id use eclipse any more help or pushes in the right direction

–

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 >>_