rex_dragArrowKey
Introduction
Get arrow key event from dragging input. It only supports single arrow-key detecting.
Get arrow key event from dragging input. It only supports single arrow-key detecting.
Touched layer
Touched layer is the layer to cache touch events. Designer might set the touched layer to an UI layer in property "Touched layer", or "Action:Set touched layer".
Touched layer is the layer to cache touch events. Designer might set the touched layer to an UI layer in property "Touched layer", or "Action:Set touched layer".
Arrow-key events
Conditions in "Pressd", or "Released" categories will be triggered when the dragging distance is larger than sensitivity range set by "Sensitivity" in properties table.
"Condition:On detecting start", "Condition:On detecting end" will be triggered when key-pressing detecting start or end.
"Condition:Is in detecting" will return true if is in key-pressing detecting, it could be used to display the UI of virtual joystick.
Conditions in "Pressd", or "Released" categories will be triggered when the dragging distance is larger than sensitivity range set by "Sensitivity" in properties table.
"Condition:On detecting start", "Condition:On detecting end" will be triggered when key-pressing detecting start or end.
"Condition:Is in detecting" will return true if is in key-pressing detecting, it could be used to display the UI of virtual joystick.
Dragging distance
The dragging distance is the distance between origin point and current touch point. The dragging distance could be got by "Expression:DistX", "Expression:DistY".
User could get origin point and current dragging point by "Expression:OX", "Expression:OY", "Expression:CurrX", "Expression:CurrY".
The dragging distance is the distance between origin point and current touch point. The dragging distance could be got by "Expression:DistX", "Expression:DistY".
User could get origin point and current dragging point by "Expression:OX", "Expression:OY", "Expression:CurrX", "Expression:CurrY".
Direction
The dragging angle will be used to detect which key is down. The direction mode is set by "Directions" in properties table.
The dragging angle will be used to detect which key is down. The direction mode is set by "Directions" in properties table.
- Up & down
- Left & right
- 4 directions
- 8 directions
Origin point
The origin point is the touch-start point if "Reset origin" set to "No" in properties table. Use this mode for virtual joystick as sample capx shown.
If "Reset origin" set to "Yes", the origin point will be reset to current touch point when detecting any key pressing.
The different between these 2 modes is - if player wants to press a "Up" key after a "Right" key is pressed.
The origin point is the touch-start point if "Reset origin" set to "No" in properties table. Use this mode for virtual joystick as sample capx shown.
If "Reset origin" set to "Yes", the origin point will be reset to current touch point when detecting any key pressing.
The different between these 2 modes is - if player wants to press a "Up" key after a "Right" key is pressed.
- It needs to drag to left-up side if "Reset origin" set to "No".
- It needs to drag to up side if "Reset origin" set to "Yes".
Cancel dragging detecting
"Action:Cancel" will cancel the dragging detecting. An use-case is to disable any key pressing when clicking other button.
"Action:Cancel" will cancel the dragging detecting. An use-case is to disable any key pressing when clicking other button.