- Home /
The question is answered, right answer was accepted
GUITexture and text mesh
Hello !
I am making my own text editor. So far I have a text mesh that can be edited dynamically, but I would like a kind of frame around my text, like a simple rectangle for example. But a game object can contain a GUITexture and a text mesh but cannot draw both ... I would like to understand why, and if there is some kind of trick to draw both.
I already tried to have 2 gameobjects, one for the text and an other one for the GUITexture, but it's very hard to place them correctly (and GUITexture and the text can be correctly aligned for one resolution, but if the user change it ...).
Answer by Eric5h5 · Aug 19, 2012 at 09:26 PM
You can add a text mesh and a GUITexture on the same game object, but it won't work very well because text mesh uses world space coordinates and GUITexture uses viewport coordinates. It would make more sense to use GUIText, since that uses viewport coordinates too.
That was so simple -_-'
How could I miss that ? Thanks, this is quite simpler than the 2 game objects solution :)