|
To be more specific (b/c I know the title was a little confusing) : How do I make an area that is a GUI run with the game? For instance let's say the game was starcraft2 how would I put in the UI like sc's ( http://static.clanbase.com/CB/images/news/2009/screenshots/StarCraftII_UI_03.jpg )? I heard about the helper class and manager. Will this help? if so can someone link documentation or how to make and use it? Thank you very much
(comments are locked)
|
|
Sure, here is an example script from the link : http://unity3d.com/support/documentation/ScriptReference/GUI.DrawTexture.html So make a new script , copy in this code , then attach the script to your camera (well , any gameObject really). Then in the Inspector drop in your image with transparencies. After that , it's just a matter of getting the co-ordinates and scaling correct for where you want to place the images. This is handy as the Gui is using pixels, so you can work out your layout. Hope this gives some more information =] Thank you so much! This works great, thanks for posting.
Apr 14 '12 at 04:08 PM
Generic
(comments are locked)
|
Can I have a direct link on how to do this? I don't fully understand how I could do this without making a button. Also, does the alpha masked parts the picture that I'm using for the UI show the background instead?
(comments are locked)
|
|
Look at @alucardj answer for documentation links. If a camera has the GUILayer object added to it, it renders GUI objects. When you render GUI elements to the camera, the GUI elements will get overlayed over the 3D scene that the camera sees. Sorry, I didn't mean to be rude. I just thought that the answer needed a little bit more explanation besides the links to the documentation. I don't mind removing my answer if you add some explanation about the GUI. I just wanted to add the parts that I was confused about when I first read about the GUI in Unity.
Apr 13 '12 at 04:54 PM
dkNinja
no worries , and I'm sorry too. You were right to suggest an explaination. I had this happening in other places, but here you are cool, you were just trying to help.
Apr 14 '12 at 02:55 AM
alucardj
(comments are locked)
|

Maybe start with GUI , Buttons and Textures?
http://unity3d.com/support/documentation/Components/GUI%20Scripting%20Guide.html
http://unity3d.com/support/documentation/ScriptReference/GUI.html
http://unity3d.com/support/documentation/ScriptReference/GUI.Button.html
http://unity3d.com/support/documentation/ScriptReference/GUI.DrawTexture.html