Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: Wumpee on October 04, 2015, 06:14:17 AM
-
Hi, I have a couple of cases where I have a panel with an embedded scroll view, and when I drag the parent panel around, the scroll view hitches and looks bad.
Is there a particular way to set up something like this?
e.g. I have a Map with a title bar, which can be used to drag the entire map. The map itself can be scrolled around as it is much larger than the scroll view.
Panel_Map
- Title Bar (Has UIDragObject with Panel_Map as target)
- Panel (scroll view)
- Texture (map)
This seems like a logical setup to me, but it just doesn't work nicely at all - it's like the panels are updating in the wrong order, or the scroll view isn't fully in local space.
-
I just did this simple test:
1. New scene.
2. Added a panel.
3. Added a child sprite with a collider to it, UIDragObject on it set to point to panel from #2.
4. Added a scroll view underneath panel from #2.
5. Added a sprite underneath the scroll view.
Running the scene and dragging the sprite from #3 works fine and there are no hitches. What are you doing differently?
-
I just did this simple test:
1. New scene.
2. Added a panel.
3. Added a child sprite with a collider to it, UIDragObject on it set to point to panel from #2.
4. Added a scroll view underneath panel from #2.
5. Added a sprite underneath the scroll view.
Running the scene and dragging the sprite from #3 works fine and there are no hitches. What are you doing differently?
I just followed those exact steps, and when I drag the title bar (Sprite from #3) around, the sprite from #5 hitches around
This is on my work PC too, and as a new scene in a different project, so it's showing the exact the same issue I'm seeing at home.
-
What version of NGUI?
Make sure the hierarchy looks like this:
UIRoot
- Camera
- Panel 1 (draggable)
-- Sprite (UIDragObject set to target panel 1)
-- Scroll View
--- Sprite
-
3.9.2 at home, and 3.8.0 at the office
-
Please be sure to update to the latest. Also note that the UIDragObject script updates are based on the mouse updates, so if your mouse update rate is 30 Hz, you will only get 30 updates per second. This is why in the draggable window example that comes with NGUI I use an interpolation script to make it smoother.
-
Thanks for that.
It's funny but I've noticed this issue in the past several times, but it wasn't critical to get it fixed until now, and then you fix it without me noticing :)