|
Java Code - GUI
[Back]
Code:
var text: GUIText; //Hold a GUI Text
var image: GUITexture; //Hold a GUI Texture
var Image_01: Texture2D; //Hold a 2D Image
var text : GameObject; //Hold Game Object
text.guiText.text = "Hello"; //Change Text
GUI TEXT--------------------------------------------------------------
guiText.fontSize = 30; //change the fontsize
guiText.pixelOffset = Vector2(Screen.width/2-440, Screen.height/2-300); //Change the offset of the text
function OnGUI ()
{
guiText.text = "Name:\nHello."; //edit text
//the \n make a new line
}
GUI TEXTURE--------------------------------------------------------------
image.texture = Image_01; //change the image texture
var image: GUITexture; //Hold a GUI Texture
var Image_01: Texture2D; //Hold a 2D Image
var text : GameObject; //Hold Game Object
text.guiText.text = "Hello"; //Change Text
GUI TEXT--------------------------------------------------------------
guiText.fontSize = 30; //change the fontsize
guiText.pixelOffset = Vector2(Screen.width/2-440, Screen.height/2-300); //Change the offset of the text
function OnGUI ()
{
guiText.text = "Name:\nHello."; //edit text
//the \n make a new line
}
GUI TEXTURE--------------------------------------------------------------
image.texture = Image_01; //change the image texture