12 natives. Read-only natives only look things up; the rest change something. Parameter types use the language's names (Types).
$touch_box.add_axis(axis_type: int, keymap: Reference, x_alias: string, y_alias: string) -> list
Add axis features to the entity's touch box.
| Parameter | Type | Meaning |
|---|
axis_type | int | The type of gesture the box should respond to. |
keymap | Reference | The keymap used to trigger the related alias. |
x_alias | string | Input alias for the x-axis to trigger. |
y_alias | string | Input alias for the y-axis to trigger. |
Returns list: Returns the axis handles (x, y) used by the touch box.
$touch_box.add_gesture(gesture_type: int, keymap: Reference, alias: string) -> int
Add gesture detection to the entity's touch box.
| Parameter | Type | Meaning |
|---|
gesture_type | int | The type of gesture the box should respond to. |
keymap | Reference | The keymap used to trigger the related alias. |
alias | string | Input alias for this box to trigger. |
Returns int: Returns the gesture handle used by the touch box.
$touch_box.create(bounds_min: vec2, bounds_max: vec2) -> bool
Creates a touch box instance from cache.
| Parameter | Type | Meaning |
|---|
bounds_min | vec2 | Minimum bounds for the box. |
bounds_max | vec2 | Maximum bounds for the box. |
Returns bool: Returns if the box was created successfully.
$touch_box.get_axis_data() -> list
Gets axis data from a touch box.
Returns list: Returns a list containing joystick axis data.
$touch_box.get_hold_time() -> float
Gets the amount of time the box has been held down.
Returns float: Returns time (in seconds) the box has been held down.
$touch_box.get_input_delta() -> vec2
Gets last input delta from a touch box.
Returns vec2: Returns the last updated input delta.
$touch_box.get_pressure() -> float
Gets touch pressure.
Returns float: Returns touch pressure in a range of 0-10.
$touch_box.get_was_tapped(gesture_handle: int) -> int
Gets the number of total taps if the box was tapped this frame.
| Parameter | Type | Meaning |
|---|
gesture_handle | int | Handle to the gesture data. |
Returns int: Returns > 0 if tapped otherwise 0.
$touch_box.reset(gesture_handle: int)
Resets gesture data for a given touch box allowing them to be retriggered.
| Parameter | Type | Meaning |
|---|
gesture_handle | int | Gesture data to reset. |
$touch_box.set_axis_active_bounds(active_bounds: vec4)
Set normalize bounds this axis should be active in.
| Parameter | Type | Meaning |
|---|
active_bounds | vec4 | The normalize screen bounds. |
$touch_box.set_threshold(gesture_handle: int, threshold: float)
Set threshold using a gesture handle.
| Parameter | Type | Meaning |
|---|
gesture_handle | int | Handle to the gesture data. |
threshold | float | The threshold value to use for the gesture type. |
$touch_box.set_threshold_range(gesture_handle: int, min_threshold: float, max_threshold: float)
Set range of thresholds using a gesture handle.
| Parameter | Type | Meaning |
|---|
gesture_handle | int | Handle to the gesture data. |
min_threshold | float | The min threshold value to use for the gesture type. |
max_threshold | float | The max threshold value to use for the gesture type. |