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 ZaStarcrafter · Nov 28, 2011 at 10:21 AM · guirenderingviewport

How do I restrict rendering to a viewport for only some elements ?

Hello,

I designed a GUI system that uses GUITexts and GUITexture for my GUI. My classes are wrapper for GUITexts and GUITexture.

A problem raised when I was asked to make a scrolling menu that doesn't take up the whole screen space. In cpp it would be easy, I just change the viewport before some specific GUI components are drawn and then change it back, but unfortunately I don't know when are the GUITexts and GUITextures drawn.

How can I restrict the rendering viewport for some specific GUITexts and GUITextures ?

I'm using Unity Pro, so I have access to the GL class.

Comment
Add comment · Show 1
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 aldonaletto · Nov 28, 2011 at 11:09 AM 0
Share

GUIText and GUITexture are rendered in the camera's GUILayer. I suppose you could disable the GUILayer in the main camera, and use an auxiliary camera with only this layer enabled to render the GUI elements. If necessary, you could use OnPreRender/OnPostRender in this camera's script to change the settings.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Bunny83 · Nov 28, 2011 at 12:02 PM

Unfortunately i don't see much hope for your approach. GUITexture and GUIText are drawn in the cameras GUILayer and you don't get any callbacks when they are drawn.

GUITexture and GUIText are part of the "old" GUI system. The "new" GUI system is much more powerful. In the new system you can define element goups or ready-to-use scroll-container which would clip / scroll the content as you like. The downside is that it's almost just scripting and not as much WYSIWYG as GUITexture. But you can even use the GUILayout function which do automatic layouting (similar to HTML-DOM in a webbrowser).

However there are some edit-time GUI designers around (Antares Universe provides such an editor AFAIK).

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

GUI Text rendering problem in WebGL 3 Answers

DrawTexture on RenderTexture without Camera 1 Answer

How do I switch from LWRP back to the standard pipeline? 1 Answer

AR glasses, unity app renders left image on both L/R screens 0 Answers

Scale canvas to camera's viewport rect? 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