@defold-typescript/types 0.40.0 → 0.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-availability.json +3963 -772
- package/api-migrations.json +27 -0
- package/api-signatures.json +18069 -10240
- package/api-targets.json +448 -11
- package/examples/translations.json +560 -89
- package/fixtures/messages_doc.json +96 -0
- package/generated/b2d.d.ts +680 -4
- package/generated/b2d_body.d.ts +29 -103
- package/generated/b2d_chain.d.ts +5 -6
- package/generated/b2d_fixture.d.ts +34 -38
- package/generated/b2d_joint.d.ts +503 -25
- package/generated/b2d_shape.d.ts +183 -20
- package/generated/b2d_world.d.ts +57 -63
- package/generated/buffer.d.ts +16 -15
- package/generated/builtin-messages.d.ts +7 -1
- package/generated/bullet3d.d.ts +91 -0
- package/generated/bullet3d_collision_object.d.ts +433 -0
- package/generated/bullet3d_constraint.d.ts +818 -0
- package/generated/bullet3d_rigid_body.d.ts +429 -0
- package/generated/bullet3d_shape.d.ts +123 -0
- package/generated/bullet3d_world.d.ts +492 -0
- package/generated/camera.d.ts +29 -32
- package/generated/collectionfactory.d.ts +15 -18
- package/generated/collectionproxy.d.ts +22 -6
- package/generated/compute.d.ts +12 -238
- package/generated/crash.d.ts +24 -10
- package/generated/editor-vm/http.d.ts +90 -7
- package/generated/editor-vm/image.d.ts +7 -7
- package/generated/editor-vm/json.d.ts +11 -0
- package/generated/editor-vm/localization.d.ts +7 -7
- package/generated/editor-vm/tilemap_tiles.d.ts +56 -10
- package/generated/editor-vm/zip.d.ts +28 -0
- package/generated/editor.d.ts +1496 -430
- package/generated/factory.d.ts +21 -25
- package/generated/font.d.ts +64 -22
- package/generated/go.d.ts +235 -182
- package/generated/graphics.d.ts +335 -97
- package/generated/gui.d.ts +240 -471
- package/generated/html5.d.ts +2 -2
- package/generated/http.d.ts +28 -35
- package/generated/image.d.ts +105 -72
- package/generated/json.d.ts +34 -16
- package/generated/kinds/gui-script.d.ts +7 -0
- package/generated/kinds/render-script.d.ts +7 -0
- package/generated/kinds/script.d.ts +7 -0
- package/generated/label.d.ts +77 -7
- package/generated/liveupdate.d.ts +13 -10
- package/generated/material.d.ts +312 -360
- package/generated/model.d.ts +40 -39
- package/generated/particlefx.d.ts +19 -28
- package/generated/physics.d.ts +365 -133
- package/generated/profiler.d.ts +13 -23
- package/generated/render.d.ts +237 -297
- package/generated/resource.d.ts +664 -583
- package/generated/socket.d.ts +120 -133
- package/generated/sound.d.ts +62 -31
- package/generated/sprite.d.ts +31 -17
- package/generated/sys.d.ts +234 -190
- package/generated/tilemap.d.ts +21 -16
- package/generated/timer.d.ts +34 -21
- package/generated/versions/defold-1.12.4/b2d_body.d.ts +0 -7
- package/generated/versions/defold-1.12.4/buffer.d.ts +1 -3
- package/generated/versions/defold-1.12.4/camera.d.ts +21 -21
- package/generated/versions/defold-1.12.4/collectionfactory.d.ts +9 -9
- package/generated/versions/defold-1.12.4/collectionproxy.d.ts +2 -2
- package/generated/versions/defold-1.12.4/crash.d.ts +2 -2
- package/generated/versions/defold-1.12.4/factory.d.ts +15 -16
- package/generated/versions/defold-1.12.4/go.d.ts +6 -12
- package/generated/versions/defold-1.12.4/gui.d.ts +77 -175
- package/generated/versions/defold-1.12.4/html5.d.ts +1 -1
- package/generated/versions/defold-1.12.4/http.d.ts +0 -13
- package/generated/versions/defold-1.12.4/image.d.ts +16 -33
- package/generated/versions/defold-1.12.4/index.d.ts +1 -0
- package/generated/versions/defold-1.12.4/json.d.ts +10 -6
- package/generated/versions/defold-1.12.4/label.d.ts +2 -3
- package/generated/versions/defold-1.12.4/liveupdate.d.ts +5 -3
- package/generated/versions/defold-1.12.4/model.d.ts +2 -10
- package/generated/versions/defold-1.12.4/particlefx.d.ts +2 -5
- package/generated/versions/defold-1.12.4/physics.d.ts +69 -67
- package/generated/versions/defold-1.12.4/profiler.d.ts +2 -5
- package/generated/versions/defold-1.12.4/render.d.ts +99 -128
- package/generated/versions/defold-1.12.4/resource.d.ts +120 -148
- package/generated/versions/defold-1.12.4/socket.d.ts +34 -60
- package/generated/versions/defold-1.12.4/sound.d.ts +8 -8
- package/generated/versions/defold-1.12.4/sprite.d.ts +15 -5
- package/generated/versions/defold-1.12.4/sys.d.ts +37 -71
- package/generated/versions/defold-1.12.4/tilemap.d.ts +18 -11
- package/generated/versions/defold-1.12.4/timer.d.ts +5 -3
- package/generated/versions/defold-1.12.4/vmath.d.ts +0 -21
- package/generated/versions/defold-1.12.4/window.d.ts +1 -16
- package/generated/versions/defold-1.13.0/b2d_body.d.ts +10 -55
- package/generated/versions/defold-1.13.0/b2d_fixture.d.ts +25 -25
- package/generated/versions/defold-1.13.0/b2d_shape.d.ts +169 -8
- package/generated/versions/defold-1.13.0/b2d_world.d.ts +16 -10
- package/generated/versions/defold-1.13.0/buffer.d.ts +1 -3
- package/generated/versions/defold-1.13.0/camera.d.ts +25 -25
- package/generated/versions/defold-1.13.0/collectionfactory.d.ts +9 -9
- package/generated/versions/defold-1.13.0/collectionproxy.d.ts +2 -2
- package/generated/versions/defold-1.13.0/compute.d.ts +0 -69
- package/generated/versions/defold-1.13.0/crash.d.ts +2 -2
- package/generated/versions/defold-1.13.0/editor-vm/tilemap_tiles.d.ts +3 -3
- package/generated/versions/defold-1.13.0/editor.d.ts +34 -24
- package/generated/versions/defold-1.13.0/factory.d.ts +15 -16
- package/generated/versions/defold-1.13.0/go.d.ts +6 -12
- package/generated/versions/defold-1.13.0/graphics.d.ts +73 -37
- package/generated/versions/defold-1.13.0/gui.d.ts +77 -175
- package/generated/versions/defold-1.13.0/html5.d.ts +1 -1
- package/generated/versions/defold-1.13.0/http.d.ts +0 -13
- package/generated/versions/defold-1.13.0/image.d.ts +16 -33
- package/generated/versions/defold-1.13.0/index.d.ts +1 -0
- package/generated/versions/defold-1.13.0/json.d.ts +10 -6
- package/generated/versions/defold-1.13.0/label.d.ts +2 -3
- package/generated/versions/defold-1.13.0/liveupdate.d.ts +7 -5
- package/generated/versions/defold-1.13.0/material.d.ts +68 -106
- package/generated/versions/defold-1.13.0/model.d.ts +2 -10
- package/generated/versions/defold-1.13.0/particlefx.d.ts +2 -5
- package/generated/versions/defold-1.13.0/physics.d.ts +69 -67
- package/generated/versions/defold-1.13.0/profiler.d.ts +2 -5
- package/generated/versions/defold-1.13.0/render.d.ts +99 -128
- package/generated/versions/defold-1.13.0/resource.d.ts +126 -150
- package/generated/versions/defold-1.13.0/socket.d.ts +34 -60
- package/generated/versions/defold-1.13.0/sound.d.ts +8 -8
- package/generated/versions/defold-1.13.0/sprite.d.ts +15 -5
- package/generated/versions/defold-1.13.0/sys.d.ts +37 -71
- package/generated/versions/defold-1.13.0/tilemap.d.ts +18 -11
- package/generated/versions/defold-1.13.0/timer.d.ts +5 -3
- package/generated/versions/defold-1.13.0/vmath.d.ts +0 -21
- package/generated/versions/defold-1.13.0/window.d.ts +1 -16
- package/generated/versions/defold-1.13.1/b2d.d.ts +33 -0
- package/generated/versions/defold-1.13.1/b2d_body.d.ts +636 -0
- package/generated/versions/defold-1.13.1/b2d_chain.d.ts +106 -0
- package/generated/versions/defold-1.13.1/b2d_fixture.d.ts +157 -0
- package/generated/versions/defold-1.13.1/b2d_joint.d.ts +823 -0
- package/generated/versions/defold-1.13.1/b2d_shape.d.ts +400 -0
- package/generated/versions/defold-1.13.1/b2d_world.d.ts +320 -0
- package/generated/versions/defold-1.13.1/buffer.d.ts +189 -0
- package/generated/versions/defold-1.13.1/camera.d.ts +303 -0
- package/generated/versions/defold-1.13.1/collectionfactory.d.ts +151 -0
- package/generated/versions/defold-1.13.1/collectionproxy.d.ts +93 -0
- package/generated/versions/defold-1.13.1/compute.d.ts +237 -0
- package/generated/versions/defold-1.13.1/crash.d.ts +143 -0
- package/generated/versions/defold-1.13.1/editor-vm/http.d.ts +56 -0
- package/generated/versions/defold-1.13.1/editor-vm/image.d.ts +48 -0
- package/generated/versions/defold-1.13.1/editor-vm/json.d.ts +10 -0
- package/generated/versions/defold-1.13.1/editor-vm/localization.d.ts +42 -0
- package/generated/versions/defold-1.13.1/editor-vm/tilemap_tiles.d.ts +80 -0
- package/generated/versions/defold-1.13.1/editor-vm/zip.d.ts +10 -0
- package/generated/versions/defold-1.13.1/editor-vm/zlib.d.ts +24 -0
- package/generated/versions/defold-1.13.1/editor.d.ts +1121 -0
- package/generated/versions/defold-1.13.1/factory.d.ts +124 -0
- package/generated/versions/defold-1.13.1/font.d.ts +81 -0
- package/generated/versions/defold-1.13.1/go.d.ts +1107 -0
- package/generated/versions/defold-1.13.1/graphics.d.ts +411 -0
- package/generated/versions/defold-1.13.1/gui.d.ts +2353 -0
- package/generated/versions/defold-1.13.1/html5.d.ts +55 -0
- package/generated/versions/defold-1.13.1/http.d.ts +77 -0
- package/generated/versions/defold-1.13.1/image.d.ts +131 -0
- package/generated/versions/defold-1.13.1/index.d.ts +57 -0
- package/generated/versions/defold-1.13.1/json.d.ts +80 -0
- package/generated/versions/defold-1.13.1/kinds/editor-script.d.ts +14 -0
- package/generated/versions/defold-1.13.1/label.d.ts +93 -0
- package/generated/versions/defold-1.13.1/liveupdate.d.ts +142 -0
- package/generated/versions/defold-1.13.1/material.d.ts +408 -0
- package/generated/versions/defold-1.13.1/model.d.ts +272 -0
- package/generated/versions/defold-1.13.1/msg.d.ts +10 -0
- package/generated/versions/defold-1.13.1/particlefx.d.ts +163 -0
- package/generated/versions/defold-1.13.1/physics.d.ts +559 -0
- package/generated/versions/defold-1.13.1/profiler.d.ts +235 -0
- package/generated/versions/defold-1.13.1/render.d.ts +1190 -0
- package/generated/versions/defold-1.13.1/resource.d.ts +1523 -0
- package/generated/versions/defold-1.13.1/socket.d.ts +784 -0
- package/generated/versions/defold-1.13.1/sound.d.ts +292 -0
- package/generated/versions/defold-1.13.1/sprite.d.ts +175 -0
- package/generated/versions/defold-1.13.1/sys.d.ts +678 -0
- package/generated/versions/defold-1.13.1/tilemap.d.ts +208 -0
- package/generated/versions/defold-1.13.1/timer.d.ts +125 -0
- package/generated/versions/defold-1.13.1/types.d.ts +61 -0
- package/generated/versions/defold-1.13.1/vmath.d.ts +774 -0
- package/generated/versions/defold-1.13.1/window.d.ts +183 -0
- package/generated/versions/defold-1.13.1/zlib.d.ts +41 -0
- package/generated/vmath.d.ts +1 -21
- package/generated/window.d.ts +71 -71
- package/identity-vocabulary.json +561 -0
- package/index.d.ts +7 -0
- package/package.json +18 -2
- package/scripts/example-store-io.ts +12 -1
- package/scripts/extension-goldens.ts +1 -0
- package/scripts/fidelity-baseline.json +146 -46
- package/scripts/generate-api-availability.ts +90 -12
- package/scripts/generate-api-signatures.ts +12 -2
- package/scripts/import-defold-release.ts +106 -26
- package/scripts/prose-constants.ts +77 -16
- package/scripts/regen.ts +391 -77
- package/scripts/shared-handle-methods.ts +53 -0
- package/scripts/signature-store-fs.ts +1 -0
- package/scripts/sync-api-docs.ts +48 -10
- package/src/api-availability.ts +0 -0
- package/src/api-doc.ts +201 -3
- package/src/api-identity.ts +252 -0
- package/src/core-types.ts +26 -3
- package/src/correction-pins.ts +49 -0
- package/src/doc-comment.ts +104 -11
- package/src/doc-corrections.ts +108 -0
- package/src/editor-vm-globals.d.ts +5 -2
- package/src/emit-dts.ts +2064 -281
- package/src/emit-messages.ts +52 -0
- package/src/example-store.ts +125 -14
- package/src/field-correction-coverage.ts +204 -0
- package/src/fnv1a.ts +16 -0
- package/src/go-overloads.d.ts +25 -6
- package/src/index-base-table.ts +145 -0
- package/src/index-slot-classifications.ts +588 -0
- package/src/index.ts +38 -5
- package/src/library-index-slot-classifications.ts +332 -0
- package/src/lifecycle.ts +61 -199
- package/src/luals-type-expr.ts +354 -0
- package/src/msg-overloads.d.ts +0 -1
- package/src/param-correction-provenance.ts +8 -11
- package/src/render-overloads.d.ts +0 -15
- package/src/return-correction-provenance.ts +58 -16
- package/src/sys-overloads.d.ts +48 -0
- package/src/vmath-overloads.d.ts +27 -1
- package/src/window-event-guard.d.ts +6 -9
- package/url-parameters.json +1 -2
package/src/lifecycle.ts
CHANGED
|
@@ -1,122 +1,137 @@
|
|
|
1
1
|
import type { Hash, Url } from "./core-types";
|
|
2
2
|
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
3
|
+
// Fields and docs follow the go ref-doc's `on_input.touch` STRUCT, whose keys are
|
|
4
|
+
// the ones comp_script.cpp pushes; lifecycle-member-docs drift-guards the docs
|
|
5
|
+
// against it, and a ref-doc re-pin is reconciled by hand.
|
|
6
6
|
export interface InputTouch {
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Identifier for the touch during its lifetime.
|
|
9
9
|
*/
|
|
10
10
|
id?: number;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Whether the finger was pressed this frame.
|
|
13
13
|
*/
|
|
14
14
|
pressed?: boolean;
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Whether the finger was released this frame.
|
|
17
17
|
*/
|
|
18
18
|
released?: boolean;
|
|
19
19
|
/**
|
|
20
|
-
* Number of taps, one for single
|
|
20
|
+
* Number of taps, such as one for a single tap and two for a double tap.
|
|
21
21
|
*/
|
|
22
22
|
tap_count?: number;
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* Touch x-coordinate.
|
|
25
25
|
*/
|
|
26
26
|
x?: number;
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
28
|
+
* Touch y-coordinate.
|
|
29
29
|
*/
|
|
30
30
|
y?: number;
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* Change in the touch x-coordinate.
|
|
33
33
|
*/
|
|
34
34
|
dx?: number;
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* Change in the touch y-coordinate.
|
|
37
37
|
*/
|
|
38
38
|
dy?: number;
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
40
|
+
* Touch x-coordinate in screen space.
|
|
41
41
|
*/
|
|
42
|
-
|
|
42
|
+
screen_x?: number;
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
44
|
+
* Touch y-coordinate in screen space.
|
|
45
45
|
*/
|
|
46
|
-
|
|
46
|
+
screen_y?: number;
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
48
|
+
* Change in the touch x-coordinate in screen space.
|
|
49
49
|
*/
|
|
50
|
-
|
|
50
|
+
screen_dx?: number;
|
|
51
|
+
/**
|
|
52
|
+
* Change in the touch y-coordinate in screen space.
|
|
53
|
+
*/
|
|
54
|
+
screen_dy?: number;
|
|
51
55
|
}
|
|
52
56
|
|
|
53
|
-
//
|
|
54
|
-
//
|
|
55
|
-
// ref-doc re-pin is reconciled by hand
|
|
56
|
-
// lifecycle-member-docs.
|
|
57
|
+
// Fields and docs follow the go ref-doc's `on_input.action` STRUCT, whose keys are
|
|
58
|
+
// the ones comp_script.cpp pushes; lifecycle-member-docs drift-guards the docs
|
|
59
|
+
// against it, and a ref-doc re-pin is reconciled by hand.
|
|
57
60
|
export interface InputAction {
|
|
58
61
|
/**
|
|
59
|
-
*
|
|
62
|
+
* Amount of input, usually 1 for buttons or between 0 and 1 for analogue input; absent for pointer movement and text input.
|
|
60
63
|
*/
|
|
61
64
|
value?: number;
|
|
62
65
|
/**
|
|
63
|
-
*
|
|
66
|
+
* Whether the input was pressed this frame; absent for pointer movement and text input.
|
|
64
67
|
*/
|
|
65
68
|
pressed?: boolean;
|
|
66
69
|
/**
|
|
67
|
-
*
|
|
70
|
+
* Whether the input was released this frame; absent for pointer movement and text input.
|
|
68
71
|
*/
|
|
69
72
|
released?: boolean;
|
|
70
73
|
/**
|
|
71
|
-
*
|
|
74
|
+
* Whether the input was repeated this frame; absent for pointer movement and text input.
|
|
72
75
|
*/
|
|
73
76
|
repeated?: boolean;
|
|
74
77
|
/**
|
|
75
|
-
*
|
|
78
|
+
* Pointer x-coordinate; absent for gamepad, key, and text input.
|
|
76
79
|
*/
|
|
77
80
|
x?: number;
|
|
78
81
|
/**
|
|
79
|
-
*
|
|
82
|
+
* Pointer y-coordinate; absent for gamepad, key, and text input.
|
|
80
83
|
*/
|
|
81
84
|
y?: number;
|
|
82
85
|
/**
|
|
83
|
-
*
|
|
86
|
+
* Pointer x-coordinate in screen space; absent for gamepad, key, and text input.
|
|
84
87
|
*/
|
|
85
88
|
screen_x?: number;
|
|
86
89
|
/**
|
|
87
|
-
*
|
|
90
|
+
* Pointer y-coordinate in screen space; absent for gamepad, key, and text input.
|
|
88
91
|
*/
|
|
89
92
|
screen_y?: number;
|
|
90
93
|
/**
|
|
91
|
-
*
|
|
94
|
+
* Change in the pointer x-coordinate; absent for gamepad, key, and text input.
|
|
92
95
|
*/
|
|
93
96
|
dx?: number;
|
|
94
97
|
/**
|
|
95
|
-
*
|
|
98
|
+
* Change in the pointer y-coordinate; absent for gamepad, key, and text input.
|
|
96
99
|
*/
|
|
97
100
|
dy?: number;
|
|
98
101
|
/**
|
|
99
|
-
*
|
|
102
|
+
* Change in the pointer x-coordinate in screen space; absent for gamepad, key, and text input.
|
|
100
103
|
*/
|
|
101
104
|
screen_dx?: number;
|
|
102
105
|
/**
|
|
103
|
-
*
|
|
106
|
+
* Change in the pointer y-coordinate in screen space; absent for gamepad, key, and text input.
|
|
104
107
|
*/
|
|
105
108
|
screen_dy?: number;
|
|
106
109
|
/**
|
|
107
|
-
*
|
|
110
|
+
* Accelerometer x value, when present.
|
|
111
|
+
*/
|
|
112
|
+
acc_x?: number;
|
|
113
|
+
/**
|
|
114
|
+
* Accelerometer y value, when present.
|
|
115
|
+
*/
|
|
116
|
+
acc_y?: number;
|
|
117
|
+
/**
|
|
118
|
+
* Accelerometer z value, when present.
|
|
119
|
+
*/
|
|
120
|
+
acc_z?: number;
|
|
121
|
+
/**
|
|
122
|
+
* Index of the gamepad that provided the input.
|
|
108
123
|
*/
|
|
109
124
|
gamepad?: number;
|
|
110
125
|
/**
|
|
111
|
-
* Id of the user associated with the controller.
|
|
126
|
+
* Id of the user associated with the controller.
|
|
112
127
|
*/
|
|
113
128
|
userid?: number;
|
|
114
129
|
/**
|
|
115
|
-
*
|
|
130
|
+
* SDL-compatible guid, supplied with a gamepad-connected action.
|
|
116
131
|
*/
|
|
117
132
|
gamepad_guid?: string;
|
|
118
133
|
/**
|
|
119
|
-
* Parsed guid
|
|
134
|
+
* Parsed guid information, supplied with a gamepad-connected action.
|
|
120
135
|
*/
|
|
121
136
|
gamepad_guid_info?: {
|
|
122
137
|
vendor: number;
|
|
@@ -126,37 +141,33 @@ export interface InputAction {
|
|
|
126
141
|
version: number;
|
|
127
142
|
};
|
|
128
143
|
/**
|
|
129
|
-
*
|
|
144
|
+
* Whether the input originated from an unknown or unmapped gamepad.
|
|
130
145
|
*/
|
|
131
146
|
gamepad_unknown?: boolean;
|
|
132
147
|
/**
|
|
133
|
-
* Name of
|
|
148
|
+
* Name of a connected gamepad.
|
|
134
149
|
*/
|
|
135
150
|
gamepad_name?: string;
|
|
136
151
|
/**
|
|
137
|
-
*
|
|
152
|
+
* Axis values, supplied only for raw gamepad input.
|
|
138
153
|
*/
|
|
139
154
|
gamepad_axis?: number[];
|
|
140
155
|
/**
|
|
141
|
-
*
|
|
156
|
+
* Hat values, supplied only for raw gamepad input.
|
|
142
157
|
*/
|
|
143
|
-
|
|
158
|
+
gamepad_hats?: number[];
|
|
144
159
|
/**
|
|
145
|
-
*
|
|
160
|
+
* Button values, supplied only for raw gamepad input.
|
|
146
161
|
*/
|
|
147
162
|
gamepad_buttons?: number[];
|
|
148
163
|
/**
|
|
149
|
-
*
|
|
164
|
+
* Touch inputs, one entry per finger.
|
|
150
165
|
*/
|
|
151
166
|
touch?: InputTouch[];
|
|
152
167
|
/**
|
|
153
|
-
* Text
|
|
168
|
+
* Text entered by a text action, or the current sequence for marked-text composition such as Japanese Kana.
|
|
154
169
|
*/
|
|
155
170
|
text?: string;
|
|
156
|
-
/**
|
|
157
|
-
* Sequence of entered symbols while entering a symbol combination, for example Japanese Kana.
|
|
158
|
-
*/
|
|
159
|
-
marked_text?: string;
|
|
160
171
|
}
|
|
161
172
|
|
|
162
173
|
/**
|
|
@@ -277,159 +288,10 @@ export interface ScriptHooks<TSelf, TInitState = TSelf> {
|
|
|
277
288
|
* to signal that it wants input to be consumed.
|
|
278
289
|
* See the documentation of acquire_input_focus for more
|
|
279
290
|
* information.
|
|
280
|
-
* The `action` parameter is a table containing data about the input mapped to the
|
|
281
|
-
* `action_id`.
|
|
282
|
-
* For mapped actions it specifies the value of the input and if it was just pressed or released.
|
|
283
|
-
* Actions are mapped to input in an input_binding-file.
|
|
284
|
-
* Mouse movement is specifically handled and uses `nil` as its `action_id`.
|
|
285
|
-
* The `action` only contains positional parameters in this case, such as x and y of the pointer.
|
|
286
|
-
* Here is a brief description of the available table fields:
|
|
287
|
-
*
|
|
288
|
-
* Field
|
|
289
|
-
* Description
|
|
290
|
-
*
|
|
291
|
-
* `value`
|
|
292
|
-
* The amount of input given by the user. This is usually 1 for buttons and 0-1 for analogue inputs. This is not present for mouse movement and text input.
|
|
293
|
-
*
|
|
294
|
-
* `pressed`
|
|
295
|
-
* If the input was pressed this frame. This is not present for mouse movement and text input.
|
|
296
|
-
*
|
|
297
|
-
* `released`
|
|
298
|
-
* If the input was released this frame. This is not present for mouse movement and text input.
|
|
299
|
-
*
|
|
300
|
-
* `repeated`
|
|
301
|
-
* If the input was repeated this frame. This is similar to how a key on a keyboard is repeated when you hold it down. This is not present for mouse movement and text input.
|
|
302
|
-
*
|
|
303
|
-
* `x`
|
|
304
|
-
* The x value of a pointer device, if present. This is not present for gamepad, key and text input.
|
|
305
|
-
*
|
|
306
|
-
* `y`
|
|
307
|
-
* The y value of a pointer device, if present. This is not present for gamepad, key and text input.
|
|
308
|
-
*
|
|
309
|
-
* `screen_x`
|
|
310
|
-
* The screen space x value of a pointer device, if present. This is not present for gamepad, key and text input.
|
|
311
|
-
*
|
|
312
|
-
* `screen_y`
|
|
313
|
-
* The screen space y value of a pointer device, if present. This is not present for gamepad, key and text input.
|
|
314
|
-
*
|
|
315
|
-
* `dx`
|
|
316
|
-
* The change in x value of a pointer device, if present. This is not present for gamepad, key and text input.
|
|
317
|
-
*
|
|
318
|
-
* `dy`
|
|
319
|
-
* The change in y value of a pointer device, if present. This is not present for gamepad, key and text input.
|
|
320
|
-
*
|
|
321
|
-
* `screen_dx`
|
|
322
|
-
* The change in screen space x value of a pointer device, if present. This is not present for gamepad, key and text input.
|
|
323
|
-
*
|
|
324
|
-
* `screen_dy`
|
|
325
|
-
* The change in screen space y value of a pointer device, if present. This is not present for gamepad, key and text input.
|
|
326
|
-
*
|
|
327
|
-
* `gamepad`
|
|
328
|
-
* The index of the gamepad device that provided the input. See table below about gamepad input.
|
|
329
|
-
*
|
|
330
|
-
* `touch`
|
|
331
|
-
* List of touch input, one element per finger, if present. See table below about touch input
|
|
332
|
-
*
|
|
333
|
-
* `text`
|
|
334
|
-
* Text input from a (virtual) keyboard or similar.
|
|
335
|
-
*
|
|
336
|
-
* `marked_text`
|
|
337
|
-
* Sequence of entered symbols while entering a symbol combination, for example Japanese Kana.
|
|
338
|
-
*
|
|
339
|
-
* Gamepad specific fields:
|
|
340
|
-
*
|
|
341
|
-
* Field
|
|
342
|
-
* Description
|
|
343
|
-
*
|
|
344
|
-
* `gamepad`
|
|
345
|
-
* The index of the gamepad device that provided the input.
|
|
346
|
-
*
|
|
347
|
-
* `userid`
|
|
348
|
-
* Id of the user associated with the controller. Usually only relevant on consoles.
|
|
349
|
-
*
|
|
350
|
-
* `gamepad_guid`
|
|
351
|
-
* The guid of the gamepad controller. Only passed with "connected" action.
|
|
352
|
-
*
|
|
353
|
-
* `gamepad_guid_info`
|
|
354
|
-
* Parsed guid info table. Only passed with "connected" action. See table below.
|
|
355
|
-
*
|
|
356
|
-
* `gamepad_unknown`
|
|
357
|
-
* True if the input originated from an unknown/unmapped gamepad.
|
|
358
|
-
*
|
|
359
|
-
* `gamepad_name`
|
|
360
|
-
* Name of the gamepad
|
|
361
|
-
*
|
|
362
|
-
* `gamepad_axis`
|
|
363
|
-
* List of gamepad axis values. For raw gamepad input only.
|
|
364
|
-
*
|
|
365
|
-
* `gamepadhats`
|
|
366
|
-
* List of gamepad hat values. For raw gamepad input only.
|
|
367
|
-
*
|
|
368
|
-
* `gamepad_buttons`
|
|
369
|
-
* List of gamepad button values. For raw gamepad input only.
|
|
370
|
-
*
|
|
371
|
-
* Touch input table:
|
|
372
|
-
*
|
|
373
|
-
* Field
|
|
374
|
-
* Description
|
|
375
|
-
*
|
|
376
|
-
* `id`
|
|
377
|
-
* A number identifying the touch input during its duration.
|
|
378
|
-
*
|
|
379
|
-
* `pressed`
|
|
380
|
-
* True if the finger was pressed this frame.
|
|
381
|
-
*
|
|
382
|
-
* `released`
|
|
383
|
-
* True if the finger was released this frame.
|
|
384
|
-
*
|
|
385
|
-
* `tap_count`
|
|
386
|
-
* Number of taps, one for single, two for double-tap, etc
|
|
387
|
-
*
|
|
388
|
-
* `x`
|
|
389
|
-
* The x touch location.
|
|
390
|
-
*
|
|
391
|
-
* `y`
|
|
392
|
-
* The y touch location.
|
|
393
|
-
*
|
|
394
|
-
* `dx`
|
|
395
|
-
* The change in x value.
|
|
396
|
-
*
|
|
397
|
-
* `dy`
|
|
398
|
-
* The change in y value.
|
|
399
|
-
*
|
|
400
|
-
* `acc_x`
|
|
401
|
-
* Accelerometer x value (if present).
|
|
402
|
-
*
|
|
403
|
-
* `acc_y`
|
|
404
|
-
* Accelerometer y value (if present).
|
|
405
|
-
*
|
|
406
|
-
* `acc_z`
|
|
407
|
-
* Accelerometer z value (if present).
|
|
408
|
-
*
|
|
409
|
-
* Guid info table:
|
|
410
|
-
* This info is only passed with a `connected` action.
|
|
411
|
-
*
|
|
412
|
-
* Field
|
|
413
|
-
* Description
|
|
414
|
-
*
|
|
415
|
-
* `vendor`
|
|
416
|
-
* USB vendor id. E.g. Nintendo 0x057e, Sony 0x054c, or Microsoft 0x045e
|
|
417
|
-
*
|
|
418
|
-
* `product`
|
|
419
|
-
* USB product id
|
|
420
|
-
*
|
|
421
|
-
* `bus`
|
|
422
|
-
* How device is communicating. E.g.0x0003 for USB devices and 0x0005 for Bluetooth devices.
|
|
423
|
-
*
|
|
424
|
-
* `crc`
|
|
425
|
-
* SDL CRC16 signature, typically used when vendor and product ids are unavailable
|
|
426
|
-
*
|
|
427
|
-
* `version`
|
|
428
|
-
* The device or firmware version
|
|
429
291
|
*
|
|
430
292
|
* @param self - reference to the script state to be used for storing data
|
|
431
293
|
* @param action_id - id of the received input action, as mapped in the input_binding-file
|
|
432
|
-
* @param action - a table containing the input data
|
|
294
|
+
* @param action - a table containing the input data; `InputAction` documents its fields
|
|
433
295
|
* @example
|
|
434
296
|
* ```ts
|
|
435
297
|
* on_input(self, action_id, action) {
|