playMaker

Author Topic: GUI rendering above black  (Read 4405 times)

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
GUI rendering above black
« on: May 25, 2014, 01:46:19 AM »
For some reason the GUI elements are drawing on top of the fullscreen black.  I set fullscreen color to black, then load GUI elements, wait 1/2 a sec and then fade from black to the screen.  For some reason no matter what I do it seems the GUI elements are on top of the background.  So they pop up and are no affected by a fade in or out.  I put them in the same area as a test and it still does it.  Any ideas?

redikann

  • PlayMaker2 Beta
  • Full Member
  • *
  • Posts: 185
Re: GUI rendering above black
« Reply #1 on: May 25, 2014, 10:54:10 AM »
Everything draws into the order you stack it into a state. So if you need a fullscreen color to overlay your gui it needs to be last. If you put a fullscreen color first and then a Set GUI aLpha after it you can fade all your gui elements that follow your set alpha but not your fullscreen color.

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
Re: GUI rendering above black
« Reply #2 on: May 25, 2014, 04:11:20 PM »
I'm not following you.  I've tried 100 different versions of this.  So set gui skin, setbox, gui label and THEN drawscreen full color black, then wait .5 sec????  Tried that.  I know this has got to be a simple fix.  BTW: doing it like I just said and no gui elements show up at all.

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
Re: GUI rendering above black
« Reply #3 on: May 25, 2014, 04:21:06 PM »
SO, if I have a state that has gui boxes and labels, then go to another state that has gui buttons, then when the buttons load, will it destroy the boxes and labels?  Maybe that's my problem.   Do all of the GUI elements need to be in 1 state?

redikann

  • PlayMaker2 Beta
  • Full Member
  • *
  • Posts: 185
Re: GUI rendering above black
« Reply #4 on: May 25, 2014, 04:23:59 PM »
Well the easy way here is a Set GUI alpha. You can animate a float to fade it probably like how your fade the black screen. One float could do both.

And yes whatever state you are in will only draw what's in it. If you leave that state then you leave that ongui call.

redikann

  • PlayMaker2 Beta
  • Full Member
  • *
  • Posts: 185
Re: GUI rendering above black
« Reply #5 on: May 25, 2014, 04:36:01 PM »
You could also have this split up on maybe 2 different empty game objects. Each one would run their FSM at the same time thus getting a screen fade out and a screen fade in if this is what you are going for.

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
Re: GUI rendering above black
« Reply #6 on: May 25, 2014, 04:45:14 PM »
I put all of the gui elements on 1 state in a fsm.  at the bottom I do a fade in.  So they all fade in at the same time.  But now when I click a button, all of the gui elements pop away.  I guess the ongui function is destroyed.  Is there a way to keep them so I can fade them down with the hieracy items at the same time?

redikann

  • PlayMaker2 Beta
  • Full Member
  • *
  • Posts: 185
Re: GUI rendering above black
« Reply #7 on: May 25, 2014, 04:50:49 PM »
Yes you would need to split your calls up. So if you have a button or header that needs to stay then separate that FSM from button that prompt a new screen.

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
Re: GUI rendering above black
« Reply #8 on: May 26, 2014, 03:52:26 AM »
"Yes you would need to split your calls up. So if you have a button or header that needs to stay then separate that FSM from button that prompt a new screen."

HU?

==============
I have found part of the issue and now understand a lot more about GUI.  I have all of the GUI elements in 1 FSM and 1 state, but also have elements in the hieracy.  I'd like to have the buttons go away when I press a button (which it does) but keep the other GUI elements on screen so they can fade out with the hieracy elements.  So I know I have to move the GUI labels and boxes to another FSM so they don't get destroyed with the buttons.  But am not clear on this.

redikann

  • PlayMaker2 Beta
  • Full Member
  • *
  • Posts: 185
Re: GUI rendering above black
« Reply #9 on: May 26, 2014, 10:22:36 AM »
Sorry for previous quick posting.  I usually create a parent child hierarchy of game objects to draws different portions of a menu with different player interactions. If a parent or child is enabled it will draw it's content, when disabled it will not draw.

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
Re: GUI rendering above black
« Reply #10 on: May 27, 2014, 11:02:59 PM »
OK, so I figurered it out.

1) on FSM #1 I have a state with fade in, set gui skin, send event, gui buttons.  2) On FSM #2 I have all non button gui elements.

So after fade in and set gui skin, I send an event to start FSM #2 (which only has 2 states).  That way, the buttons stay separate from the other elements.

Thanks for your help