Author Topic: built in screen scroll by mouse?  (Read 1204 times)


  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 14
    • View Profile
built in screen scroll by mouse?
« on: July 22, 2014, 12:20:49 AM »
Does NGUI provide an out of the box way of implementing dragging screen around the 2d world?
I can define max x and y. I am doing it by creating my own 2d collider and handling things myself but i was wondering if there is a better way.



  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: built in screen scroll by mouse?
« Reply #1 on: July 22, 2014, 08:53:29 PM »
UIDragObject lets you drag objects. UIDragCamera lets you drag the camera. For anything else, just create a custom script that has OnPress/OnDrag and do what you want inside. If you want this script to work regardless of what you pressed on, set UICamera.genericEventHandler to be the game object where you have this script attached.