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.
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).