Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: ergoproxy on September 09, 2013, 02:45:27 PM

Title: Dragging is too fast
Post by: ergoproxy on September 09, 2013, 02:45:27 PM
Hi Guys.

Great tool you have there. Worth every cent. I am creating a game which needs an diablo style inventory.

For every Inventory-Item-slot I set up a DragDropContainer in which I put the Item which is a UIImageButton + DragDropItem. When I start the scene and start dragging then the IconSprite is way too fast. It won't stay on the cursor but shoots off 50px on the screen every 1px I move the mouse. How can that be? I don't use a UITable or anything else.

What am I missing? Why is the delta from OnDrag() so fast?

Thanks for NGUI and your help

-ErgoProxy


Title: Re: Dragging is too fast
Post by: ergoproxy on September 09, 2013, 02:47:55 PM
http://www.tasharen.com/forum/index.php?topic=5737.msg27181#msg27181 (http://www.tasharen.com/forum/index.php?topic=5737.msg27181#msg27181)

I was not sure if this is the same problem so I created a new Thread.

To be clear: The Sprites gets dragged in the right directions, but too far.
Title: Re: Dragging is too fast
Post by: ArenMook on September 10, 2013, 07:14:11 AM
Something like this is generally caused by you messing up the scales. Everything leading up to your dragged object must keep the scale of (1, 1, 1), except the UIRoot. If it doesn't, you will see weird results.
Title: Re: Dragging is too fast
Post by: ergoproxy on September 10, 2013, 12:51:57 PM
Thanks for the quick response, ArenMook.

The scales were all set up correctly (1,1,1);

I studied your example #11 a little bit more today. It seems I missed the DragAndDropRoot *duh*. Deleting this script causes the dragging to go nasa space rocket.

Cheers from germany.