playMaker

Author Topic: GUI Text disappears behind GUI TEXTURE  (Read 4658 times)

KozTheBoss

  • Full Member
  • ***
  • Posts: 150
  • You dont fail unless you give up trying to succeed
    • Pixel Life - portfolio
GUI Text disappears behind GUI TEXTURE
« on: April 11, 2013, 07:34:47 AM »
so i have a gui texture object and i have a gui TEXT object that i want displayed on TOP of the texture (basicly its like a tooltip when the player does a mouseover of an item in the game world.

The Texture is the backdrop window for the text, and the texture has actions that gets mouse position in world, converts it to a screen position and sets its own position to the screen position every frame so the texture follows the mouse and this works great!

The GUI Text is a child of the GUI texture and also has the follow mouse actions. this also works great, except the gui text appears behind the texture so i cant see the text

I know it has something to do with Z position, but it sets that automatically when it calculates screen position, and even though the text has a lower Z value than the texture, it still displays behind (lower Z's should display in front)

Any simple fix for this, or do i have to get all complicated and stuff?

Any help appriciated!
Remember, you don't fail unless you give up trying to succeed!

Saputo

  • Full Member
  • ***
  • Posts: 107
Re: GUI Text disappears behind GUI TEXTURE
« Reply #1 on: April 11, 2013, 08:26:20 AM »
I had the same problem when attempting this,atlest you got yours to show the text when u moused over I couldn't get that,but with testing of the text my text would go behind the gui, so I was going to look into fixing this by making my own font, to see if it brings it out more.

KozTheBoss

  • Full Member
  • ***
  • Posts: 150
  • You dont fail unless you give up trying to succeed
    • Pixel Life - portfolio
Re: GUI Text disappears behind GUI TEXTURE
« Reply #2 on: April 11, 2013, 08:44:29 AM »
i fixed this partially - it seems that if the text is a child of the GUI it will always show BELOW the GUI no matter what - i made an invis GO and made both the texture and the text a child of that empty GO, so the texture and the text are now sisters.

The weird part now is that it works perfectly fine for that object, but if i want another GUI tooltip and i take and copy the exact empty GO with all children, it does NOT work.. the text shows up behind the texture again

Also if i take the text that works on the texture that works, and i COPY the text and replace the original text it also does not work - even though its the exact same object, with the exact same actions and the exact same settings, it shows up BEHIND the GUI texture again..

WTF?! im so frustrated with this by now =( spent hours on this
Remember, you don't fail unless you give up trying to succeed!

KozTheBoss

  • Full Member
  • ***
  • Posts: 150
  • You dont fail unless you give up trying to succeed
    • Pixel Life - portfolio
Re: GUI Text disappears behind GUI TEXTURE
« Reply #3 on: April 11, 2013, 09:00:47 AM »
double checked

everything about the 2 gameobjects are exactly the same and one of them works and the other one doesn't..

Even making a new one from the bottom instead of copying doesnt work! =((((((((((
Remember, you don't fail unless you give up trying to succeed!

Saputo

  • Full Member
  • ***
  • Posts: 107
Re: GUI Text disappears behind GUI TEXTURE
« Reply #4 on: April 11, 2013, 09:51:58 AM »
Had the same prob with using GUI Textures, so I had to use 2D ToolKit Sprites when I made my IGM (In Game Menu), which is a downfall b.c the sprites if used for a background pic as well, wont fit the screen size, so I've been trying to find a work around. But for some reason the GUI's always stayed in front of another GUI when set as a child,so I had to use sprites.

KozTheBoss

  • Full Member
  • ***
  • Posts: 150
  • You dont fail unless you give up trying to succeed
    • Pixel Life - portfolio
Re: GUI Text disappears behind GUI TEXTURE
« Reply #5 on: April 12, 2013, 06:46:03 AM »
my menu is just alot of planes with textures on them ( a plane for each button, backdrop window and background ) in the 3D world rendered with an orthographic camera

This makes everything a lot easier to move around and control as you want instead of using GUI textures when the scene isnt composed of anything else anyway :)

This is still early stage and WIP
Remember, you don't fail unless you give up trying to succeed!

Alatriste

  • Full Member
  • ***
  • Posts: 193
Re: GUI Text disappears behind GUI TEXTURE
« Reply #6 on: September 26, 2015, 05:59:48 PM »
Hi, I'm a bit late to this discussion, but I found a way to solve the problem of one texture being overlapping the text string. I solved it using the "Draw Texture" action to draw the texture and after I added the "GUI Label" action to display the text. Is the only way I made it work in an "easy way" when both action are in the same FSM (in my case, in the camera itself)