Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - dmonk

Pages: [1]
1
NGUI 3 Support / Problems with multiple UIPanels at same depth
« on: July 21, 2014, 10:57:20 PM »
I am in the process of upgrading from NGUI 3.0.7 f3 to 3.6.8, and after integrating everything down and fixing the compile issues and what not, I have one new bug that I cant' figure out.

I have a scene that has two UIPanels - the UIRoot Panel, at a depth of 0, and a nested ScrollView Panel, which is also at a depth of zero.  However, in this scene, regardless of the depth value of the widgits I place within the scrollview, they always are drawn behind the root panel.
 
If I bump the depth of the nested scroll view, then the widgits in the scrollview panel do in fact draw on top.  But I need the panels to both remain at the same depth, because I have other elements in the root panel, with greater depths, that I want to be able to draw on top of the scrollview (tooltips, error dialogs, etc).  So I can't just bump the ScrollView panel depth to 1 to force it to be on top.

Other data points:
I have another scene with this exact same setup, and the panels work correctly. I have scoured every parameter of the panels and widgits between the two scenes, and can find no differences.
 
If I create a new empty game object in this scene, assign it UIRoot, UIPanel, and RigidBody components, and drag the entire hierarchy from the old UIRoot object into the new UIRoot object, the ScrollView widgets suddenly begin to work correctly.  Until I save the scene, exit unity, and reload the scene.
 
This setup worked correctly prior to the upgrade. 
 
It's almost as if it were treating depth as a float, and this were some sort of odd floating point error, but I can clearly see depth is an int on UIPanel. But regardless, something is forcing all of the widgits in my scrollview panel to draw behind the root panel, regardless of what I set their depth to, even though both panels are set to a depth of 0.
 
Thoughts?

2
NGUI 3 Support / Integrating Unity 2D Hud Elements into NGUI
« on: February 11, 2014, 11:43:41 AM »
So I'm looking for some feedback on the best way to tackle this problem.  What I'm attempting to do is to integrate uWebKit's 2D WebGui elements into NGUI. I've already integrated their WebTexture elements into NGUI by essentially taking the same approach that UITexture does, and just treating the web texture like any other texture.  This works really well, but their (uWebKit's)  3d Texture web view has some limitations.
 
Their 2D Web View hower provides a very nice, crisp, clear web browser interface.  In order to do so though, it uses Unity's native GUI support, which of course doesn't know anything at all about NGUI's nice anchoring and layering architecture.

I know that the HUD element won't respect panel depth, but I can live with that.  (it's always going to be on top anyway).  My first thought is to create a thinly derived UIWidget class that has the 2D Web GUI object attached, and at each update (or if the widgit has been marked dirty) to reset the gui element's location and extents based on the widgit's updated screen location and extents.  This seems like it would at least get the hud element to respect the widgit's boundaries.
 
So has anyone done something simlar, and have any recommendations?  Or is there an existing sample script that integrates a Unity Hud element into an NGUI widgit?

Pages: [1]