Author Topic: Modal Panel  (Read 11327 times)

caldofran

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 14
    • View Profile
Modal Panel
« on: January 13, 2015, 06:30:10 AM »
Hi,

I'm making a modal Panel with a "wait for server" message, it works perfectly by setting the depth higher than the rest of panels on the screen... it's an UIPanel (with a 1000 depth) with a UISprite (with a 1001 depth) which has a huge collider to make it modal. But if there is a ScrollView in the back screen it always shows in front of the modal Panel-Sprite...

The ScrollView has only "2" depth, and other sprites in the back screen are shown behind the modal panel (even with higher depths)... i've notice that if i put a "-5" depth the scrollview disappears (behind his UIPanel parent)...

I've search in the forum but only found the opposite issue, Scrollviews that do not show within a modal panel... Can anybody help me?

I've updated today the NGUI version.

Thanks

devomage

  • Sr. Member
  • ****
  • Thank You
  • -Given: 7
  • -Receive: 67
  • Posts: 250
    • View Profile
Re: Modal Panel
« Reply #1 on: January 13, 2015, 07:32:06 AM »
ive had similar problems.  check the attached screenshot...

easily reproduced.

caldofran

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 14
    • View Profile
Re: Modal Panel
« Reply #2 on: January 13, 2015, 08:05:26 AM »
Yep, seems that we both have the same problem...  :'(

As a workaround we could change the depth at runtime when the modal screen appears...

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Modal Panel
« Reply #3 on: January 13, 2015, 05:08:48 PM »
Depth of sprites is relative to the panel. Otherwise what would be the point of having depth on panels? Think of panels as folders, and widgets as files.

caldofran

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 14
    • View Profile
Re: Modal Panel
« Reply #4 on: January 14, 2015, 04:40:48 AM »
Hi Aren,

Yep, i understand the depth concept, but here is my "UI Tree" (very simplified):

Back Panel (1 depth)
 - ScrollView (2 depth)
 - Other Widgets (3+ depth)
Modal Panel (1000 depth)
 - Other Widgets (1001+ depth)

The ScrollView in the back panel shows in front of the modal panel... obviously i've something wrong... but i think the depths are correctly typed... i'll try to look over again..


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Modal Panel
« Reply #5 on: January 14, 2015, 09:47:50 PM »
Assuming you left the panels using automatic render queue, your modal panel will be in front.

caldofran

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 14
    • View Profile
Re: Modal Panel
« Reply #6 on: January 15, 2015, 06:14:38 AM »
Hi Aren, first of all, thanks for your assistance...

Yes, the render queue is left as default, indeed I also tried to set the modal panel with a 4000 value, with no difference... I'm assuming that it's my fault when configuring something, so i'll post the solution when i find the problem...

Thanks anyway!

devomage

  • Sr. Member
  • ****
  • Thank You
  • -Given: 7
  • -Receive: 67
  • Posts: 250
    • View Profile
Re: Modal Panel
« Reply #7 on: January 15, 2015, 07:14:47 AM »
export an example of the problem...

caldofran

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 14
    • View Profile
Re: Modal Panel
« Reply #8 on: January 15, 2015, 07:31:38 AM »
think i cannot do that, because i'll be publishing ArenMook scripts, which is not allowed...

devomage

  • Sr. Member
  • ****
  • Thank You
  • -Given: 7
  • -Receive: 67
  • Posts: 250
    • View Profile
Re: Modal Panel
« Reply #9 on: January 15, 2015, 05:36:45 PM »
think i cannot do that, because i'll be publishing ArenMook scripts, which is not allowed...

of course you cant include purchased assets.  just dont include NGUI or TNET, etc.

it appears you are at a standstill unless you either post a project or post screenshots.  just trying to help ;p

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Modal Panel
« Reply #10 on: January 15, 2015, 09:01:31 PM »
If depths are set up properly and the render queue is automatic, then the only other possible explanation left is that you've messed up your layers. All UI elements need to be using the same layer, and this layer must be only drawn by one camera -- your UI camera.

caldofran

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 14
    • View Profile
Re: Modal Panel
« Reply #11 on: January 16, 2015, 11:40:57 AM »
Hi,

I was losing too much time, so i decided to redo that two panels, in less than a hour i've all working... unfortunatelly I still know what was wrong...  :(

Thank you all anyway...