Hi basically I stumped I am trying to have a menu or layout that allows there to be an image (texture or icon) load within the window and text on another part explaining the image.
So button one shows image one and text for image one, button two shows image two and text for image two and so on.
For the most part I have worked around some of the layout issues (in around about way) but can't change the textures on the click of the button.
Please be gentle I am new (3 weeks) and I am a not a programmer so I am up to my chest in water at the moment. Ta
This is what I am using at the moment:
Screen.lockCursor = false;
GameObject.Find("FPC").GetComponent("MouseLook").enabled = false; GameObject.Find("FPC").GetComponent("Crosshair").enabled = false;
Time.timeScale = 0;
/* Button Content examples */ var img1 : Texture2D; var img2 : Texture2D; var img3 : Texture2D; var img4 : Texture2D; var img5 : Texture2D; var img6 : Texture2D;
var windowRect : Rect = Rect (175, 150, 600, 600);
function OnGUI () {
windowRect = GUI.Window (0, windowRect, WindowFunction, "SCOTT'S BOOK:");
}
function WindowFunction (windowID : int) { // Draw any Controls inside the window here
if (GUI.Button (Rect (1,16,598,400), img1)) {
print ("you clicked the img");
}
if (GUI.Button (Rect (1,434,598,145), "ARTISTS NOTES:
We are please to reveal to you a unique experiencing in online photographic exhibition…
Blah Blah checking code annd new line works", “button”)) {
print (“you clicked the icon”);
}
if (GUI.Button (Rect (1,415, 100, 20), "img1", "button")) {
print ("img1");
}
if (GUI.Button (Rect (99,415, 100, 20), "img2", "button")) {
print ("img2");
}
if (GUI.Button (Rect (199 ,415, 100, 20), "img3", "button")) {
print ("img3");
}
if (GUI.Button (Rect (299 ,415, 100, 20), "img4", "button")) {
print ("img4");
}
if (GUI.Button (Rect (399 ,415, 100, 20), "img5", "button")) {
print ("img5");
}
if (GUI.Button (Rect (499 ,415, 100, 20), "img6", "button")) {
print ("img6");
}
if (GUI.Button (Rect (1,579, 597, 20), "Close", "button")) {
print ("you closed the window");
Destroy (this);
Time.timeScale = 1;
GameObject.Find("FPC").GetComponent("MouseLook").enabled = true; GameObject.Find("FPC").GetComponent("Crosshair").enabled = true;
gameObject.AddComponent ("LockCursorNew");
Screen.lockCursor = true;
}
}
@Scott, You probably noticed that the whole code of your post looks kinda weird.. right?
– anon4553185