|
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 () {
} function WindowFunction (windowID : int) { // Draw any Controls inside the window here
if (GUI.Button (Rect (1,434,598,145), "ARTISTS NOTES:\n\n We are please to reveal to you a unique experiencing in online photographic exhibition.....\n\n Blah Blah checking code annd new line works", "button")) { print ("you clicked the icon"); }
GameObject.Find("FPC").GetComponent("MouseLook").enabled = true; GameObject.Find("FPC").GetComponent("Crosshair").enabled = true; gameObject.AddComponent ("LockCursorNew");
}
(comments are locked)
|
|
I'm still a bit of a noob to scripting, but hopefully this should help you to get your click texture change. If nothing else, get you started.
As for what you have above for your buttons, you might want to look into GUILayout scripts. Unity's site has a great script reference and it's come in handy many times.
(comments are locked)
|
|
If you are not a programmer you should first learn how to code before getting yourself into a position where you need to code to solve a problem. There are many books, websites, and schools that teach programming. Some even teach programming with an emphasis on game design. Start there young Jedi. Be patient and the your path will become clear. If you can't do that that you should consider hiring a programmer to help you. What kind of answer is that? You gotta start somewhere... might as well just jump at it! :)
Feb 02 '11 at 09:35 AM
GearWorker
that guy must be a programmer with no job because graphic designers now lear to do scripting by ourself.. yeah!
Dec 27 '11 at 03:14 AM
qinghill
(comments are locked)
|

@Scott, You probably noticed that the whole code of your post looks kinda weird.. right?