Author Topic: Flash/blink when switching panels  (Read 4345 times)

krillmcrawl

  • Guest
Flash/blink when switching panels
« on: March 04, 2013, 07:13:15 AM »
Hi!

I have a problem when using NGui when I'm switching between panels. I often get a flash/blink when no GUI graphics is drawed, I think it's only one frame. It is quite annoying since my GUI is fullscreen (think Quiz game).

I have tried both in playmaker with Activate gameobject on the panels and through scripting (NGUITools.SetActive(nextPanelObject, true)) but results are the same.

Any ideas?

Best Regards,

Kristian

Malzbier

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 93
    • View Profile
Re: Flash/blink when switching panels
« Reply #1 on: March 04, 2013, 08:04:37 AM »
I had the problem to.

The problem was with transparent panels :
Deactivating Panel 1  Activating Panel 2  -> Flicker because one ore two frames in between there is no active Panel.

The solution for transparent background was that i used one background Panel for all foreground and only changed the foreground so the background does not flicker.
The solution for Opaque Panel would be to activate the new panel first and wait one or two frames and the deactivate the old Panel.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Flash/blink when switching panels
« Reply #2 on: March 04, 2013, 08:15:35 AM »
Disabling a panel is instant, while Enabling it is a frame delayed.

BroadcastMessage("CreatePanel") to your UIPanel and it should fix it. Or try calling Refresh() on your panel.

krillmcrawl

  • Guest
Re: Flash/blink when switching panels
« Reply #3 on: March 04, 2013, 09:45:07 AM »
Thanks! I added Refresh() after making the panel active and it seems to work well!

Kristian