Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: yo_milo on August 07, 2014, 01:46:09 PM

Title: [solved]Problem drag components
Post by: yo_milo on August 07, 2014, 01:46:09 PM
Hey, Hello.

I do not usually post here... But recently, I wanted to use the Drag components from NGUI, and they do not seem to work properly for me.

At first, I just created a Sprite, added a box collider, and slapped in UIDragObject, and tried it out.

If I have Keep Visible off, it behaves properly; however, if I turn on Keep Visible, and specify the container with an invisible widget (Or anything for that matters), it constraints my movement per click to:
x +- 134, Y +- 103

However, I can still click again, and move it multiple times, and go outside of bounds, with no restrictions.
(https://dl.dropboxusercontent.com/u/68873911/help/Inspector.PNG)


I wanted to keep the sprite in the screen bounds, and I thought it would be possible to do in NGUI without having to write any scripts.


Problem 2:
Also, once you guys are here (I do not know if I should do a second thread for this other problem, but it is kind of related)

I was looking at the video tutorials because, I thought maybe I was doing something wrong, and I did not want to be hasty asking a question before researching... And while doing the scroll view, dragging my Sprite worked perfectly. But when I turned on Smooth Tween in the Grid Component, my dragging stopped working correctly, as if it was pulling while I was dragging, instead of pulling when I stopped dragging...

Anyone knows how to solve this too?

EDIT:

I solved problem number two, I was missing the drag and drop root on the other Panel.


Title: Re: Problem drag components
Post by: ArenMook on August 08, 2014, 08:11:02 AM
"Content Rect" should be pointing to your content, not your container. Examine Example 12 more closely.
Title: Re: Problem drag components
Post by: yo_milo on August 14, 2014, 07:42:19 PM
Thanks