Author Topic: How to make virtual gamepad-liked event system?  (Read 4116 times)

DarkMagicCK

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 20
    • View Profile
How to make virtual gamepad-liked event system?
« on: July 01, 2014, 04:49:08 AM »
Think about a virtual four arrows gamepad on iphone, when users use this to control the characters to move.
They do not want to release their fingers, but just scroll on their screens.

But the OnPress or OnDrag event can not suit for this, while they all require users to release fingers to trigger OnPress(false) or OnDragEnd, or other buttons will not receive any event.
I know I can get the position of the touch, and check which button is there, but in such case the NGUI event make no sense.
Is there any way to do this within NGUI event system?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How to make virtual gamepad-liked event system?
« Reply #1 on: July 02, 2014, 03:18:28 AM »
OnDragOver, OnDragOut. The button component actually supports highlighting this way via an option on the button script.
« Last Edit: July 02, 2014, 03:28:55 AM by ArenMook »