Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

Search the Community

Showing results for tags 'ugui'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • GENERAL
    • Introduce yourself
    • Discussions
    • Showcase
    • Need help?
    • Seeking team members?
    • Offtopic
  • RESOURCES
    • Example Projects
    • Scripts
    • Shaders
    • Unity Tutorials
    • FPS Kit Tutorials
    • 3D models
    • Animated 3D Models
    • Graphic design
    • Textures
    • Sounds
    • Other
  • SELL | REQUEST
    • Sell
    • Request
  • Mars' Modular Multiplayer Photon FPS Kit's Topics
  • Mars' Modular Multiplayer Photon FPS Kit's Reviews
  • Mars' Modular Multiplayer Photon FPS Kit's Updates
  • Mars' Modular Multiplayer Photon FPS Kit's Tutorials
  • Busy People's Introductions
  • Photon's Tutorials
  • Photon's Photon General
  • Photon's Showcase

Categories

  • Free Projects
  • Free Assets
  • Game Demos
  • Photon's Files

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


YouTube URL


Facebook URL


Twitter URL


IndieGoGo URL


Kickstarter URL


IndieDB URL


GreenLight URL


Location:


Interests

Found 3 results

  1. Converting it can be simple. Lets take something like void string guitext; void OnGui(){ GUI.Label(new Rect(Screen.width/2 - 75, Screen.height - 100, 300, 30), guitext); } Now while this will show what you want, it would definitely be more efficient to use the new UGUI. Now at the top of your script it will say using UnityEngine; using System.Collections; we want to add a new addition to this. I'll explain next why we do this. We are going to make it now say this using UnityEngine.UI; using UnityEngine; using System.Collections; Now we add UnityEngine.UI because now we can reference our UGUI components. Now to the fun part. We are going to change our code to reference the text of our new UGUI text. We have to add a couple of new variables. So at the top of the script after the name of the class , we are going to add public Text newgui; Before if you were to try that, Text wouldn't be able to be referenced and the script would throw back errors. Now before we move on, be sure you place you UGUI text where you want it to appear on the screen. Now in the Void Update we are going to add this. void Update(){ newgui.text=guitext.ToString(); } What this will do is whatever your string is, it will replace the text component of your UGUI. This doesn't have to be strictly kept to string components. Say you have a countdown variable using INT instead. The same rules would apply and instead public int guinumber; public Text number; void Update(){ number.text=guinumber.ToString(); } This can work in conjunction with public GameObject text; void OnTriggerEnter(){ text.SetActive(true); } as to set up say a timer, where the text only shows up when you want it to. Since UGUI can be treated as a GameObject it is amazingly easy to set up the perfect timer, warning screen, ammo counter, anything. I hope this very short tutorial helped you learn some new tricks.
  2. reaperkan

    UI Text Color

    Hey Folks, I need a help with the changing color for each word it displays!! But it doesnt , can ya help me out? messageWindow.text = ""; foreach (WhoKillWho messages in whoKillWho) { messageWindow.color += messages.killerColor; messageWindow.text += messages.killer; messageWindow.color += Color.white; messageWindow.text += messages.middleText; messageWindow.color += messages.killedColor; messageWindow.text += messages.killed; messageWindow.text += "\n"; } This is the script I am using
  3. I'm at a point now where I need to start creating some guis - textfields, buttons etc, and I would like to hear if anyone has any preferences here. I'm considering OpenGUI and Unitys own uGui but since I have 0 experience with either I'm not sure what to choose. I am pretty sure though that I don't want to use basic OnGUI() because I would prefer an object/component oriented way of working - and would much rather subscribe to events than poll for input. Has anyone here tried any or both of these - any impressions good or bad? If you were to start again - which would you choose?
×
×
  • Create New...