CTNTVirtualPad.Event

From GiderosMobile
Revision as of 16:19, 3 December 2020 by MoKaLux (talk | contribs) (Created page with "__NOTOC__ '''Available since:''' Gideros 2019.4<br/> '''Class:''' VirtualPad<br/> === Description === Those are all the Events dispatched by the TNT Virtual Pad component...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Available since: Gideros 2019.4
Class: VirtualPad

Description

Those are all the Events dispatched by the TNT Virtual Pad components.

The events hold a data table containing useful information.

Joystick Events

  • PAD.LEFTPAD_EVENT
  • PAD.RIGHTPAD_EVENT

Joysticks Event data table:

  • data.selected can be true or false (true when element is interacting with user)
  • data.power value (float) from 0 to 1 (1 when stick is on the base border)
  • data.angle angle of joystick in radians. If joystick is set as digital, values are from 0 to 7 (0 is right and so on in clockwise order, steps are 45 degrees)
  • data.state is the state of the joystick. It returns PAD.STATE_NONE→joystick not pressed, PAD.STATE_BEGIN→joystick begin touch, PAD.STATE_DOWN→joystick touched and pressed, PAD.STATE_END→joystick begin release

Buttons Events

  • PAD.BUTTON1_EVENT
  • PAD.BUTTON2_EVENT
  • PAD.BUTTON3_EVENT
  • PAD.BUTTON4_EVENT
  • PAD.BUTTON5_EVENT
  • PAD.BUTTON6_EVENT

Buttons Event data table:

  • data.selected can be true or false (true when element is interacting with user)
  • data.state is the state of the button. It returns PAD.STATE_NONE→button not pressed, PAD.STATE_BEGIN→button begin touch, PAD.STATE_DOWN→button touched and pressed, PAD.STATE_END→button begin release

Example

TO DO