- Home /
GUI.DrawTexture() into a Layer?
Hey All,
I need to draw a GUITexture into a certain layer with a rotation.
I've seen I can create a new GUITexture object by GameObject->Create Other->GUITexture. This allows me to put the texture into the layer I want, BUT I have no control over it's rotation.
I can alternatively call GUI.DrawTexture() (manipulating the GUI's matrix prior to this to achieve the rotation), but I can't specify what Layer the texture would be in.
I need the best of both worlds. Is this at all possible?
Many thanks all!
Answer by Berenger · Mar 09, 2012 at 06:45 AM
What do you mean by layer ? The GUILayer is related to GUITexture and GUIText, the old GUI system. GUI.DrawTexture use the new one and don't have layers. If you are talking about getting input events, you need to see buttons or Event.current.button + Rect.Contains.
Thanks for the response.
Not talking about input layers. I need to render these GUIs into a layer/culling mask that the cameras can selective choose to render or ignore.
If you look at any Object in the inspector, it has a Layer drop down. This is the layer I speak of :)
No, because GUI calls don't use camera rendering. At all. You can disable all the cameras in your scene, and the GUI will still show- because it works independently of camera drawing. You will have to implement your own system for this, because GUI calls are not rendered by the camera!
that's what I figured, but was hoping against hope :)
Thanks for the feedback Syclamoth
Your answer
Follow this Question
Related Questions
How to change rect size? 2 Answers
Mathf.Lerp 2 Answers
Doubt with GUILayout 0 Answers
GUI 2D Bounding Box 1 Answer
Reduce Draw call for Multiple GUI Textures with same Texture 1 Answer