Author Topic: Depth issues with sprites/scrollview/grid  (Read 2227 times)

Holy Manfred

  • Jr. Member
  • **
  • Thank You
  • -Given: 1
  • -Receive: 8
  • Posts: 71
    • View Profile
Depth issues with sprites/scrollview/grid
« on: June 09, 2014, 05:09:35 PM »
I ran into an odd issue which I couldn't really figure out so far. Maybe somebody can offer some insight.

I have a screen with some buttons and a scrollview containing a grid. Works all nicely until I start putting a modal window on top of everything during runtime. The new window kind of fills most of the screen, has a collider and works fine except that all elements of the grid from the screen below it are rendered on top of it. Everything else looks fine, it is just the items in the UIGrid which are added in at runtime are rendered on top of everything.
This shouldn't happen since all the depth values are set up correctly. I suspect it having to do somehing with the Panel/Scrollview containing the UIGrid but I am not sure how to fix it.
The setup is relatively simple and looks like this:

UIRoot
=>UIWidget
==>UISprite
===>UIPanel(with UIScrollView)
====>UIGrid
=====>UISprite (this is what is visible on top of everything)

I am on 3.6.2.
Any ideas are welcome :)

PoN

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 4
  • Posts: 111
    • View Profile
Re: Depth issues with sprites/scrollview/grid
« Reply #1 on: June 10, 2014, 12:20:55 AM »
try to use UIPanel instead of UIWidget.
Worked on Doc&DogAge Of Fury 3D. Actually working on WarMach.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Depth issues with sprites/scrollview/grid
« Reply #2 on: June 10, 2014, 02:46:33 AM »
Yeah different windows should be on different panels. Easier to manage, and you can control what's on top just by adjusting their depth values.

Holy Manfred

  • Jr. Member
  • **
  • Thank You
  • -Given: 1
  • -Receive: 8
  • Posts: 71
    • View Profile
Re: Depth issues with sprites/scrollview/grid
« Reply #3 on: June 10, 2014, 12:07:30 PM »
I changed all my screens accordingly and it works smoothly now. Thanks!