playMaker

Author Topic: [SOLVED] Render GUI Text in front of of other GUI elements  (Read 5056 times)

createasaurus

  • Full Member
  • ***
  • Posts: 146
[SOLVED] Render GUI Text in front of of other GUI elements
« on: December 05, 2014, 06:31:33 PM »
I have a button image and I want to draw text onto it.
The text is a GUI Text object, with a Set GUI Text action
The button image is a 3D plane with a Unlit Cutout shader with Texture type GUI

I have been playing around with the Set GUI Depth action, but it seems to have no effect.

Attached is an image of how I'd like it to be.  This image is in photoshop.  When I try this in Unity, the text goes behind the button / frame and you cannot see it.

Thank you very much!
« Last Edit: December 11, 2014, 08:54:32 AM by Lane »

createasaurus

  • Full Member
  • ***
  • Posts: 146
Re: Render GUI Text in front of "Sprite"
« Reply #1 on: December 06, 2014, 10:41:01 AM »
In case this helps, here is some additional info.

See attached image of in game screen:
My goal is to have a solid frame with the text visible on top.
As an example, I erased half the solid part of the frame in photoshop.  In Unity, you can see the text is appearing behind the frame.  (In the final game the frame would be all solid.)

This Text and Frame is part of my HUD system which uses an orthographic camera to project elements onto the 3D gameplay.  I'm showing the Hud camera settings in the inspector, incase this is helpful information.  I've tried playing with the depth of the Hud Camera  in the inspector, but all it does is make the Frame disappear completely when the value is less the zero.

Again, any thoughts are appreciated.  Thank you very much!
« Last Edit: December 06, 2014, 11:19:45 AM by createasaurus »

createasaurus

  • Full Member
  • ***
  • Posts: 146
Re: Render GUI Text in front of other GUI elements [bumped]
« Reply #2 on: December 09, 2014, 08:52:02 AM »
Respectfully, I'm bumping this topic.  Thank you for understanding and for your help.  Please let me know if there is any additional information that can help with this request.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Render GUI Text in front of of other GUI elements [bumped]
« Reply #3 on: December 09, 2014, 10:30:08 AM »
Hi,

 no worries, bump is very needed these days :) too much activity to spot everything :)

Are you on 4.6? I would move totally to the new UI system, else I would have the background in the same state as the gui text, then you will have proper control over display order.

 Else, I would do a gui texture gameObject and a gui text gameobject and again will give you more contorl then if you use the old ui system.

Bye,

 Jean

createasaurus

  • Full Member
  • ***
  • Posts: 146
Re: Render GUI Text in front of of other GUI elements [bumped]
« Reply #4 on: December 09, 2014, 02:38:50 PM »
Quote
no worries, bump is very needed these days
Thanks for the understanding with the bump.  :)
Quote
Are you on 4.6?
Unfortunately, this project needs to be on an older version of Unity.
Quote
I would have the background in the same state as the gui text, then you will have proper control over display order.
I do not quite understand this.  The GUI Text and Frame are separate objects.  How can they be in the same state?  I think I may need to fundamentally rethink my setup, but I do not know where to begin.  Currently the GUI Text object has a Set GUI Text action set to every frame.  When I want no text, I set its string to a space, like this " ".  The frame object is a Polygon with a GUI Shader.  It has 2 states: set visibility on, and set visibility off.  I toggled this via send events.

Again, thank you very much,
Chris
« Last Edit: December 09, 2014, 03:45:11 PM by createasaurus »

createasaurus

  • Full Member
  • ***
  • Posts: 146
Re: Render GUI Text in front of of other GUI elements
« Reply #5 on: December 09, 2014, 11:02:56 PM »
OK, I got it.  I spent a long time toggling every setting I could think of on and off, just to see if anything worked.

On my HUD camera, if I enable GUILayer, the text is infront of frame.  If unenabled, the text is behind frame.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: [SOLVED] Render GUI Text in front of of other GUI elements
« Reply #6 on: December 12, 2014, 03:11:16 AM »
Hi,

 great, I am glad you got it. I would strongly recommand switchin to 4.6. I am not sure why you must keep using a old version? is it because of pro licensing, else let me know, it could be something solvable.

 Bye,

 Jean

createasaurus

  • Full Member
  • ***
  • Posts: 146
Re: [SOLVED] Render GUI Text in front of of other GUI elements
« Reply #7 on: December 17, 2014, 09:10:26 PM »
All console developers currently must use a modified Unity 4.3.  This is true for Wii U, PS4, and Xbox One.  We will jump directly to a modified Unity 5 at some undisclosed future date - when Unity releases it.  I agree, it is inconvenient not to be able to use the latest version.

Thanks again for the help.
Chris (createasaurus)
« Last Edit: December 18, 2014, 05:15:23 AM by createasaurus »