Author Topic: Touch Events  (Read 3836 times)

langem

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Touch Events
« on: August 22, 2013, 11:55:50 AM »
Hi everybody,

first post so be gentle ;) I'm using NGUI for the touch input of an android game.

I've got a left and a right button (sprite) and I'm using "onClick"-events to steer my character.

The only problem is that I always have to release the finger, if I want to press the other button.

Is there a way (event) to check if the finger is outside of the sprite? or an event that is fired if a finger slides onto a button?


thanks in advance and kind regards,

Matthias

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Touch Events
« Reply #1 on: August 22, 2013, 11:57:18 AM »
Use OnPress instead of OnClick, and uncheck "sticky press" on the UICamera.

langem

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Re: Touch Events
« Reply #2 on: August 22, 2013, 12:45:23 PM »
Awesome! Thank you!