Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Lungfish · Jan 01, 2011 at 11:58 PM · guitext

Intro GUI Text Script...

In the game I am working on, When the first level starts, I want to make a few GUI texts appear, one after the other. I don't know if I should script each text inside a script, or should I make premade gui texts and have them appear and disappear..?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Tetrad · Jan 02, 2011 at 01:25 AM

It really doesn't matter. Whatever's easier for you.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ina · Jan 02, 2011 at 04:58 AM 0
Share

hmm what about custom fonts?

avatar image Tetrad · Jan 02, 2011 at 07:54 AM 0
Share

Like I said, whichever's easiest for you. I'm assu$$anonymous$$g you can set all the fields of a procedurally created gui text in code and that would include the font settings.

avatar image
0

Answer by Lungfish · Jan 02, 2011 at 03:46 PM

But the problem is I don't actually know how to do either one...

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Lungfish · Jan 02, 2011 at 03:46 PM 0
Share

Shoot this isn't supposed to be an answer sorry.

avatar image
0

Answer by Owen-Reynolds · Mar 11, 2011 at 06:20 PM

For multiple lines, it seems easiest to make one GUIText, and then child the other lines to it. The scale is (0,1)(0,1), so (0.5,0.5) is in the center. You won't see them until Play. Maybe best to Play, tweak them where they look good, then change the settings "for real" after Stop.

This is some mostly tested demo code in C# to change the message (lineTwo is childed to the GUIText with the script. The script is on the parent GUIText):

void Start () { StartCoroutine(showStuff()); }

// A predone set of messages over time IEnumerator showStuff() { transform.guiText.text="Firing..."; yield return new WaitForSeconds(2); transform.guiText.text="Missile is fired"; // put some text in second line: transform.Find("lineTwo").guiText.text="Woe to them"; yield return new WaitForSeconds(2); transform.guiText.text=""; transform.Find("lineTwo").guiText.text=""; }

// someone else can call this for any 1-time message: public IEnumerator flashMessage(string msg, float len) { transform.guiText.text=msg; yield return new WaitForSeconds(len); transform.Find("lineTwo").guiText.text="l"; }

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

GUIText Help 1 Answer

Level Button And Quit Button Android 2 Answers

How to save and load text in a GUI TextArea 1 Answer

How do I Script GUI Text Objects? 1 Answer

Scrolling Text 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges