Reputation: 3151
I'm trying to put some GUITexts on top of GUITexture.
The GUITexture is acting as a background. The GUIText is the text on top. Unfortunately, I can't put the text on top, the GUITexture is always on top.
But none of those worked. What is the way to control the layering of these object?
Upvotes: 0
Views: 1504
Reputation: 405
There could be two major hurdles in your GuiTexture problem :
1)
2)
There should be possibility that you are using OnGui method to draw that texture so it overlaps the Guitext you are trying to see on your texture.
You should use GuiTexture Initialization on start instead of OnGui If you are using it check this may be help you and do upload some code.
Upvotes: 2
Reputation: 3234
Setting the Z value is the correct way.
You should note, that only the local Z positions of GUIText and GUITexture are used. The Z position of a parent game object is simply ignored. So if you set your GUIText's z = 1 and GUITextture's z = 0, the text is on top.
As you already tried that, there must be something wrong with your scene. Double-check that your texture is really a GUITexture and not a sprite or something else. Can you see any GUIText at all or when you disable the Background texture.
Upvotes: 2
Reputation: 301
Try making Z translation value of GUI Text higher than GUI Texture Z Value.
Upvotes: 2