Author Topic: Is NGUI support Drag Camera for RTS ( Real Time Strategy ) Game ?  (Read 3360 times)

yuewah

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 180
    • View Profile
Could you make a simple scene on how to do drag camera for RTS game using NGUI ?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,154
  • Toronto, Canada
    • View Profile
Re: Is NGUI support Drag Camera for RTS ( Real Time Strategy ) Game ?
« Reply #1 on: April 29, 2012, 09:51:12 AM »
Place a UICamera script on your Main Camera and choose "Nothing" for its Event Mask. After that set UICamera.fallThrough to a game object that has your camera-dragging logic on it, and add OnDrag() to it, doing what you want inside.

yuewah

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 180
    • View Profile
Re: Is NGUI support Drag Camera for RTS ( Real Time Strategy ) Game ?
« Reply #2 on: April 29, 2012, 09:02:43 PM »
it works as expected. How about rotating camera and zooming using multi-touch , is it possible or not ? anyway, I will give it a try.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,154
  • Toronto, Canada
    • View Profile
Re: Is NGUI support Drag Camera for RTS ( Real Time Strategy ) Game ?
« Reply #3 on: April 30, 2012, 03:05:09 AM »
You can detect different touches by checking UICamera.lastTouchID.