Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 TheMorten · May 15, 2010 at 10:57 AM · guitextviewport

How to make GUI text visible outside camera viewport?

Hey,

I'm trying to make a small info box hover next to the mouse. Currently I'm trying to do this by using a GUIText object in the scene, and then use the Update() function to sync its coordinates with the mouse.

However, the camera view port does not cover my whole screen (there are 2 chat boxes added at the bottom and to the left of the camera, taking up a lot of space). When I move the mouse into these "non-camera" areas, the GUIText won't display any more - it is limited to existing only in the camera viewport.

How do I make the GUIText object appear outside the camera viewport?

I also tried the Unity scripting reference example on how to add custom windows, but it won't work (it gives me the error "The name 'EditorWindow' does not denote a valid type"). The test code is attached below.

// JavaScript example: class MyWindow extends EditorWindow { var myString = "Hello World"; var groupEnabled = false; var myBool = true; var myFloat = 1.23;

 // Add menu named "My Window" to the Window menu
 @MenuItem ("Window/My Window")
 static function Init () {
     // Get existing open window or if none, make a new one:
     var window : MyWindow = EditorWindow.GetWindow (MyWindow);
     window.Show ();
 }

 function OnGUI () {
     GUILayout.Label ("Base Settings", EditorStyles.boldLabel);
         myString = EditorGUILayout.TextField ("Text Field", myString);

     groupEnabled = EditorGUILayout.BeginToggleGroup ("Optional Settings", groupEnabled);
         myBool = EditorGUILayout.Toggle ("Toggle", myBool);
         myFloat = EditorGUILayout.Slider ("Slider", myFloat, -3, 3);
     EditorGUILayout.EndToggleGroup ();
 }

}

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by TheMorten · May 15, 2010 at 11:22 AM

Nevermind, found the GUI class and everything went better than expected, as they say.

GUI.Label (position : Rect, text : string) is fantastic. :)

function OnGUI () {
   GUI.Label(Rect(x, y, width,height), myLabelText);
}

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

What's wrong with my function? It keeps telling me 'loseText' is not a member of 'UnityEngine.GUIText'. Please help, please and thank you! 0 Answers

Problem with GuiFont - Not appearing 0 Answers

How to make GUI Text appear after a certain amount of time 2 Answers

Problem with centering text 1 Answer

Editing certain words in a single NGUI Text Box 0 Answers


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