Author Topic: [solved]Problem drag components  (Read 1885 times)

yo_milo

  • Newbie
  • *
  • Thank You
  • -Given: 10
  • -Receive: 2
  • Posts: 36
    • View Profile
[solved]Problem drag components
« 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.



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.


« Last Edit: August 14, 2014, 07:43:04 PM by yo_milo »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Problem drag components
« Reply #1 on: August 08, 2014, 08:11:02 AM »
"Content Rect" should be pointing to your content, not your container. Examine Example 12 more closely.

yo_milo

  • Newbie
  • *
  • Thank You
  • -Given: 10
  • -Receive: 2
  • Posts: 36
    • View Profile
Re: Problem drag components
« Reply #2 on: August 14, 2014, 07:42:19 PM »
Thanks