lecodes-sdk 1.0.0 → 1.2.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/dist/global.d.ts +18 -4
- package/dist/inject.js +260 -361
- package/dist/types/animate/tween/Animation.d.ts +69 -0
- package/dist/types/animate/tween/Timeline.d.ts +55 -0
- package/dist/types/animate/tween/animateValue.d.ts +27 -0
- package/dist/types/animate/tween/easing.d.ts +29 -0
- package/dist/types/animate/tween/spec.d.ts +178 -0
- package/dist/types/g2/Node2D.d.ts +16 -0
- package/dist/types/g2/Sprite.d.ts +11 -1
- package/dist/types/gl/Camera.d.ts +15 -1
- package/dist/types/gl/Foliage.d.ts +47 -0
- package/dist/types/gl/Geometry.d.ts +24 -0
- package/dist/types/gl/Light.d.ts +28 -7
- package/dist/types/gl/Lightmap.d.ts +90 -60
- package/dist/types/gl/Material.d.ts +28 -20
- package/dist/types/gl/Model.d.ts +7 -5
- package/dist/types/gl/Node.d.ts +18 -0
- package/dist/types/gl/Particles.d.ts +55 -1
- package/dist/types/gl/Scene.d.ts +20 -0
- package/dist/types/gl/animation/AnimationClip.d.ts +19 -0
- package/dist/types/gl/animation/Animator.d.ts +27 -0
- package/dist/types/gl/animation/DynamicBone.d.ts +19 -8
- package/dist/types/gl/animation/IK.d.ts +86 -30
- package/dist/types/gl/animation/Locomotion.d.ts +52 -3
- package/dist/types/gl/animation/Warp.d.ts +2 -1
- package/dist/types/gl/animation/core.d.ts +35 -4
- package/dist/types/gl/physics/Ragdoll.d.ts +87 -12
- package/dist/types/gl/terrain/Terrain.d.ts +12 -2
- package/dist/types/inject.d.ts +8 -2
- package/dist/types/runtime/input.d.ts +7 -0
- package/dist/types/scene/defineScene.d.ts +44 -32
- package/dist/types/ui/UIButton.d.ts +3 -1
- package/dist/types/ui/UIInput.d.ts +5 -1
- package/dist/types/ui/UINode.d.ts +24 -24
- package/dist/types.json +1 -1
- package/package.json +1 -1
- package/prompts/README.md +142 -142
- package/prompts/core-design.md +27 -4
- package/prompts/core.md +35 -6
- package/prompts/dist/2d-game.md +197 -408
- package/prompts/dist/3d-app.md +166 -491
- package/prompts/dist/ar-app.md +163 -373
- package/prompts/dist/design.md +87 -83
- package/prompts/dist/ui-app.md +136 -325
- package/prompts/select.ts +19 -4
- package/src/animate/tween/Animation.ts +378 -0
- package/src/animate/tween/Timeline.ts +175 -0
- package/src/animate/tween/animateValue.ts +100 -0
- package/src/animate/tween/easing.ts +172 -0
- package/src/animate/tween/spec.ts +479 -0
- package/src/audio/audio.ts +161 -161
- package/src/bridges.d.ts +235 -65
- package/src/compile/__tests__/assetMacro.test.ts +26 -0
- package/src/compile/__tests__/detectEntry.test.ts +19 -0
- package/src/compile/__tests__/serverSplit.test.ts +27 -0
- package/src/compile/bundler.ts +34 -4
- package/src/compile/compileProject.ts +31 -1
- package/src/compile/detectEntry.ts +8 -3
- package/src/compile/index.ts +2 -0
- package/src/compile/serverSplit.ts +9 -3
- package/src/g2/Node2D.ts +38 -0
- package/src/g2/Sprite.ts +20 -1
- package/src/gl/Camera.ts +34 -1
- package/src/gl/CameraPlace.ts +52 -52
- package/src/gl/Foliage.ts +102 -0
- package/src/gl/Geometry.ts +393 -348
- package/src/gl/Light.ts +49 -16
- package/src/gl/Lightmap.ts +439 -275
- package/src/gl/Material.ts +59 -47
- package/src/gl/Mesh.ts +120 -120
- package/src/gl/Model.ts +23 -12
- package/src/gl/Node.ts +39 -0
- package/src/gl/Particles.ts +80 -2
- package/src/gl/Scene.ts +34 -1
- package/src/gl/animation/AnimationClip.ts +52 -0
- package/src/gl/animation/Animator.ts +42 -2
- package/src/gl/animation/DynamicBone.ts +35 -12
- package/src/gl/animation/IK.ts +173 -152
- package/src/gl/animation/Locomotion.ts +72 -8
- package/src/gl/animation/Playback.ts +5 -4
- package/src/gl/animation/Warp.ts +5 -2
- package/src/gl/animation/core.ts +65 -4
- package/src/gl/physics/Ragdoll.ts +451 -272
- package/src/gl/scenarios.ts +291 -291
- package/src/gl/terrain/Terrain.ts +33 -2
- package/src/inject.ts +236 -226
- package/src/runtime/input.ts +11 -0
- package/src/scene/defineScene.ts +72 -62
- package/src/scene/gizmos.ts +148 -148
- package/src/ui/UIButton.ts +2 -2
- package/src/ui/UIInput.ts +3 -3
- package/src/ui/UINode.ts +61 -36
- package/dist/types/animate/animate.d.ts +0 -20
- package/src/animate/animate.ts +0 -238
package/src/inject.ts
CHANGED
|
@@ -1,226 +1,236 @@
|
|
|
1
|
-
// THE aggregation point. Every public global the SDK provides is re-exported here under the exact
|
|
2
|
-
// name user code uses it as. The bundler passes this file to esbuild's `inject:` option, so user
|
|
3
|
-
// code references `Scene`, `Sprite`, `toast`, … with no imports; esbuild tree-shakes away whatever
|
|
4
|
-
// a given project does not use (so a pure-2D project drops all 3D classes, and vice versa).
|
|
5
|
-
//
|
|
6
|
-
// Rule: this is the ONLY file that `export`s public names. Everything else is internal and imported
|
|
7
|
-
// by it. Host-provided globals (setLoop, console, setTimeout, DEG2RAD, asset, …) are NOT here —
|
|
8
|
-
// they live in src/host.d.ts as declarations and stay as free references at runtime.
|
|
9
|
-
|
|
10
|
-
// ---- math ----
|
|
11
|
-
export { Mathf } from "./math/Mathf"
|
|
12
|
-
export { Vec2, Vec3 } from "./math/vec"
|
|
13
|
-
export { Quat } from "./math/quat"
|
|
14
|
-
export { Mat4 } from "./math/mat4"
|
|
15
|
-
export { Color } from "./core/color"
|
|
16
|
-
|
|
17
|
-
// ---- aspects (attachable node capabilities) ----
|
|
18
|
-
export { Aspect, System, type With, type SystemHost } from "./core/Aspect"
|
|
19
|
-
export { type EventMap } from "./core/events"
|
|
20
|
-
export { Time } from "./core/time"
|
|
21
|
-
export { StateMachine, defineStates, type StateDef, type StatesDef, type StateGuard, type StateHandler, type StateMachineEvents } from "./core/StateMachine"
|
|
22
|
-
export { InspectorUI } from "./core/InspectorUI"
|
|
23
|
-
|
|
24
|
-
// ---- reactivity (signals; UI text/style props also accept `() => value` bindings) ----
|
|
25
|
-
export { signal, computed, effect, type Signal, type Computed } from "./core/signals"
|
|
26
|
-
export { __compWrite, __compOp, type CompAxis, type CompWriter } from "./core/compWrite"
|
|
27
|
-
|
|
28
|
-
// ---- canvas (core 2D drawing that bakes to a texture; shared by 2D/3D/UI) ----
|
|
29
|
-
export { Canvas, Bitmap } from "./canvas/Canvas"
|
|
30
|
-
|
|
31
|
-
// ---- platform runtime (injected globals; the host provides the lower-level _creator* bridges) ----
|
|
32
|
-
export { toast, openURL, SvgSource } from "./runtime/misc"
|
|
33
|
-
export { app, type AppState, type OrientationLock } from "./runtime/app"
|
|
34
|
-
export { clipboard } from "./runtime/clipboard"
|
|
35
|
-
export { date, type DateValue, type DateInput, type Unit, type Locale } from "./runtime/datetime"
|
|
36
|
-
export { fetch, fetchLocal, FormData, File, type FetchResponse } from "./runtime/fetch"
|
|
37
|
-
export { localStorage } from "./runtime/storage"
|
|
38
|
-
export { device, type HapticStyle, type MotionOptions } from "./runtime/device"
|
|
39
|
-
export { Input, InputChannel, type InputKeyEvent, type InputGamepadEvent, type InputEventName, type GamepadState, type GamepadAxisName } from "./runtime/input"
|
|
40
|
-
export { WebSocket } from "./runtime/net"
|
|
41
|
-
// Multiplayer (docs/multiplayer-plan.md): roles, players, JSON messages over the _creatorNet transport.
|
|
42
|
-
export { Net, NetPlayer, Replicated, NetEntity, type NetMessage, type NetRole, type NetStatus, type NetEvents, type NetLaunch, type NetInput, type NetKind, type NetTransform } from "./net"
|
|
43
|
-
// App-backend transport: the compiler-generated stubs of `*.server.ts` modules call these; user code
|
|
44
|
-
// only ever imports its server functions (docs/backend-plan.md §4).
|
|
45
|
-
export { __rpc, __channel, __serverOnly, RpcError, type ClientChannel } from "./runtime/rpc"
|
|
46
|
-
export { AudioPlayer, VideoPlayer } from "./runtime/media"
|
|
47
|
-
// Game audio (docs/audio-plan.md): decoded clips, a voice pool, buses with effects; 3D through the
|
|
48
|
-
// AudioSource / AudioZone aspects (gl/) and scene.audio.
|
|
49
|
-
export { Sound, type SoundOptions } from "./audio/Sound"
|
|
50
|
-
export { Voice, type VoiceEvents } from "./audio/Voice"
|
|
51
|
-
export { Bus, REVERB_PRESETS, type ReverbPreset, type ReverbParams, type EchoParams } from "./audio/Bus"
|
|
52
|
-
export { audio, type PlaySoundOptions, type SpatialOptions, type Rolloff, type AudioStats } from "./audio/audio"
|
|
53
|
-
export { openFilePicker, files, type FileData } from "./runtime/files"
|
|
54
|
-
export { share } from "./runtime/share"
|
|
55
|
-
export { ClickEvent, TouchStartEvent, LongPressEvent } from "./runtime/touch"
|
|
56
|
-
|
|
57
|
-
// ---- 2D engine (creator-2d) ----
|
|
58
|
-
export { Scene2D } from "./g2/Scene2D"
|
|
59
|
-
export { Node2D } from "./g2/Node2D"
|
|
60
|
-
export { Camera2D } from "./g2/Camera2D"
|
|
61
|
-
export { Sprite } from "./g2/Sprite"
|
|
62
|
-
export { SpriteAnimation } from "./g2/SpriteAnimation"
|
|
63
|
-
export { Shape2D } from "./g2/Shape2D"
|
|
64
|
-
export { Physics2D } from "./g2/Physics2D"
|
|
65
|
-
export { Trigger2D } from "./g2/Trigger2D"
|
|
66
|
-
export { CharacterController2D } from "./g2/CharacterController2D"
|
|
67
|
-
export { OneWay2D } from "./g2/OneWay2D"
|
|
68
|
-
export { PhysicsGroup2D } from "./g2/groups2d"
|
|
69
|
-
export { Tilemap } from "./g2/Tilemap"
|
|
70
|
-
export { Texture2D } from "./g2/Texture2D"
|
|
71
|
-
// sprite sheets as data (.sprite.ts files — see src/g2/SpriteSheet.ts)
|
|
72
|
-
export { SpriteSheet, defineSpriteSheet } from "./g2/SpriteSheet"
|
|
73
|
-
export type { SpriteSheetDef, SheetSprite, SpriteMakeOptions } from "./g2/SpriteSheet"
|
|
74
|
-
// tilesets as data (.tiles.ts files — autotile materials, see src/g2/Tileset.ts + autotile.ts)
|
|
75
|
-
export { Tileset, defineTileset, Autotile2D } from "./g2/Tileset"
|
|
76
|
-
export { rawCell, isRawCell, rawIndex } from "./g2/autotile"
|
|
77
|
-
export { rot90, rot180, rot270, flipX, packTile, tileIndex, tileTurns, tileFlip, tileOriented } from "./g2/autotile"
|
|
78
|
-
export type {
|
|
79
|
-
TilesetDef, TileMaterial, PatchMaterial, PathMaterial, PatchSlots, EdgeSlot, FillBlock, BlockEntry,
|
|
80
|
-
TileBlock, TilePart,
|
|
81
|
-
} from "./g2/autotile"
|
|
82
|
-
// 2D scenes as data (.scene2d.ts files — see src/g2/defineScene2d.ts) + the cells('…') payload
|
|
83
|
-
export { defineScene2d, Scene2dHandle } from "./g2/defineScene2d"
|
|
84
|
-
export type { Scene2dDef, Scene2dNodeDef, Scene2dEnv, SpriteSourceDef, TilemapSourceDef, Camera2dNodeDef, LoadedScene2d } from "./g2/defineScene2d"
|
|
85
|
-
export { cells, encodeCells, type CellsData } from "./g2/cells"
|
|
86
|
-
// no-code 2D scenario aspects (attachable in scene files — see src/g2/scenarios2d.ts)
|
|
87
|
-
export { CameraFollow } from "./g2/scenarios2d"
|
|
88
|
-
|
|
89
|
-
// ---- UI (creator-ui) ----
|
|
90
|
-
export {
|
|
91
|
-
UIScreen, type UIScreenStyle,
|
|
92
|
-
UIRow, UIColumn, UIBox, type UIContainerStyle,
|
|
93
|
-
UIText, type UITextStyle,
|
|
94
|
-
UIButton, type UIButtonStyle,
|
|
95
|
-
UIImage, type UIImageStyle,
|
|
96
|
-
UIVideo, type UIVideoStyle,
|
|
97
|
-
UIInput, UITextArea, type UIInputStyle,
|
|
98
|
-
UIScrollable, type UIScrollableStyle,
|
|
99
|
-
UIPager, type UIPagerStyle,
|
|
100
|
-
UITabs, type UITabDef,
|
|
101
|
-
defineTabs, type TabDef, type TabsHandle,
|
|
102
|
-
UIWidget, type UIWidgetStyle,
|
|
103
|
-
UIModal, type UIModalStyle,
|
|
104
|
-
UIBottomSheet, type UIBottomSheetStyle,
|
|
105
|
-
UIPopover, type UIPopoverStyle,
|
|
106
|
-
UISpacer, type UISpacerStyle,
|
|
107
|
-
UIVirtualizedList,
|
|
108
|
-
Router,
|
|
109
|
-
NativeView, type UINativeViewStyle,
|
|
110
|
-
registerFont,
|
|
111
|
-
__uiMap,
|
|
112
|
-
__UIColumn, __UIRow, __UIBox, __UIButton, __UIScreen, __UIScrollable, __UIWidget,
|
|
113
|
-
} from "./ui/UI"
|
|
114
|
-
// The Presentable navigation contract (docs/navigation-presentable-plan.md). `Presentable` is
|
|
115
|
-
// interface + runtime companion (declaration merging): `Presentable.current` = what's on screen.
|
|
116
|
-
export { Presentable } from "./ui/UI"
|
|
117
|
-
export type { PresentOptions, Transition, TransitionName, TransitionSpec, TransitionTransform } from "./ui/UI"
|
|
118
|
-
// The base node type + the union a container accepts as children — documented as the signature of
|
|
119
|
-
// UIColumn/UIRow/append/etc., so they must be global (type-only; erased at runtime).
|
|
120
|
-
export type { UINode, UINodeChild } from "./ui/UINode"
|
|
121
|
-
// App theme variables (docs/ui-theme-plan.md): theme({...}) merges + returns typed var()
|
|
122
|
-
// accessors; system vars are static props (theme.primaryColor, theme["comfort-top"], …).
|
|
123
|
-
export { theme, type ThemeValues, type ThemeAccessors } from "./ui/theme"
|
|
124
|
-
|
|
125
|
-
// ---- animate ----
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
export {
|
|
129
|
-
|
|
130
|
-
//
|
|
131
|
-
|
|
132
|
-
export {
|
|
133
|
-
export {
|
|
134
|
-
export {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
export {
|
|
140
|
-
export {
|
|
141
|
-
export {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
} from "./
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
export {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
export {
|
|
160
|
-
export
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
export {
|
|
164
|
-
|
|
165
|
-
//
|
|
166
|
-
|
|
167
|
-
export
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
export {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
export {
|
|
175
|
-
export {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
export {
|
|
179
|
-
export {
|
|
180
|
-
export {
|
|
181
|
-
export {
|
|
182
|
-
export
|
|
183
|
-
export {
|
|
184
|
-
export {
|
|
185
|
-
export
|
|
186
|
-
export
|
|
187
|
-
export {
|
|
188
|
-
export
|
|
189
|
-
export {
|
|
190
|
-
export type {
|
|
191
|
-
export
|
|
192
|
-
export {
|
|
193
|
-
export type {
|
|
194
|
-
export {
|
|
195
|
-
export
|
|
196
|
-
export {
|
|
197
|
-
export {
|
|
198
|
-
export {
|
|
199
|
-
export type {
|
|
200
|
-
export {
|
|
201
|
-
export {
|
|
202
|
-
export
|
|
203
|
-
export type {
|
|
204
|
-
export {
|
|
205
|
-
export {
|
|
206
|
-
export {
|
|
207
|
-
export type {
|
|
208
|
-
export {
|
|
209
|
-
export
|
|
210
|
-
export {
|
|
211
|
-
export type {
|
|
212
|
-
export {
|
|
213
|
-
export
|
|
214
|
-
export {
|
|
215
|
-
export {
|
|
216
|
-
export {
|
|
217
|
-
export type {
|
|
218
|
-
export {
|
|
219
|
-
export type {
|
|
220
|
-
export {
|
|
221
|
-
export {
|
|
222
|
-
export {
|
|
223
|
-
export {
|
|
224
|
-
export {
|
|
225
|
-
export {
|
|
226
|
-
export
|
|
1
|
+
// THE aggregation point. Every public global the SDK provides is re-exported here under the exact
|
|
2
|
+
// name user code uses it as. The bundler passes this file to esbuild's `inject:` option, so user
|
|
3
|
+
// code references `Scene`, `Sprite`, `toast`, … with no imports; esbuild tree-shakes away whatever
|
|
4
|
+
// a given project does not use (so a pure-2D project drops all 3D classes, and vice versa).
|
|
5
|
+
//
|
|
6
|
+
// Rule: this is the ONLY file that `export`s public names. Everything else is internal and imported
|
|
7
|
+
// by it. Host-provided globals (setLoop, console, setTimeout, DEG2RAD, asset, …) are NOT here —
|
|
8
|
+
// they live in src/host.d.ts as declarations and stay as free references at runtime.
|
|
9
|
+
|
|
10
|
+
// ---- math ----
|
|
11
|
+
export { Mathf } from "./math/Mathf"
|
|
12
|
+
export { Vec2, Vec3 } from "./math/vec"
|
|
13
|
+
export { Quat } from "./math/quat"
|
|
14
|
+
export { Mat4 } from "./math/mat4"
|
|
15
|
+
export { Color } from "./core/color"
|
|
16
|
+
|
|
17
|
+
// ---- aspects (attachable node capabilities) ----
|
|
18
|
+
export { Aspect, System, type With, type SystemHost } from "./core/Aspect"
|
|
19
|
+
export { type EventMap } from "./core/events"
|
|
20
|
+
export { Time } from "./core/time"
|
|
21
|
+
export { StateMachine, defineStates, type StateDef, type StatesDef, type StateGuard, type StateHandler, type StateMachineEvents } from "./core/StateMachine"
|
|
22
|
+
export { InspectorUI } from "./core/InspectorUI"
|
|
23
|
+
|
|
24
|
+
// ---- reactivity (signals; UI text/style props also accept `() => value` bindings) ----
|
|
25
|
+
export { signal, computed, effect, type Signal, type Computed } from "./core/signals"
|
|
26
|
+
export { __compWrite, __compOp, type CompAxis, type CompWriter } from "./core/compWrite"
|
|
27
|
+
|
|
28
|
+
// ---- canvas (core 2D drawing that bakes to a texture; shared by 2D/3D/UI) ----
|
|
29
|
+
export { Canvas, Bitmap } from "./canvas/Canvas"
|
|
30
|
+
|
|
31
|
+
// ---- platform runtime (injected globals; the host provides the lower-level _creator* bridges) ----
|
|
32
|
+
export { toast, openURL, SvgSource } from "./runtime/misc"
|
|
33
|
+
export { app, type AppState, type OrientationLock } from "./runtime/app"
|
|
34
|
+
export { clipboard } from "./runtime/clipboard"
|
|
35
|
+
export { date, type DateValue, type DateInput, type Unit, type Locale } from "./runtime/datetime"
|
|
36
|
+
export { fetch, fetchLocal, FormData, File, type FetchResponse } from "./runtime/fetch"
|
|
37
|
+
export { localStorage } from "./runtime/storage"
|
|
38
|
+
export { device, type HapticStyle, type MotionOptions } from "./runtime/device"
|
|
39
|
+
export { Input, InputChannel, type InputKeyEvent, type InputGamepadEvent, type InputEventName, type GamepadState, type GamepadAxisName } from "./runtime/input"
|
|
40
|
+
export { WebSocket } from "./runtime/net"
|
|
41
|
+
// Multiplayer (docs/multiplayer-plan.md): roles, players, JSON messages over the _creatorNet transport.
|
|
42
|
+
export { Net, NetPlayer, Replicated, NetEntity, type NetMessage, type NetRole, type NetStatus, type NetEvents, type NetLaunch, type NetInput, type NetKind, type NetTransform } from "./net"
|
|
43
|
+
// App-backend transport: the compiler-generated stubs of `*.server.ts` modules call these; user code
|
|
44
|
+
// only ever imports its server functions (docs/backend-plan.md §4).
|
|
45
|
+
export { __rpc, __channel, __serverOnly, RpcError, type ClientChannel } from "./runtime/rpc"
|
|
46
|
+
export { AudioPlayer, VideoPlayer } from "./runtime/media"
|
|
47
|
+
// Game audio (docs/audio-plan.md): decoded clips, a voice pool, buses with effects; 3D through the
|
|
48
|
+
// AudioSource / AudioZone aspects (gl/) and scene.audio.
|
|
49
|
+
export { Sound, type SoundOptions } from "./audio/Sound"
|
|
50
|
+
export { Voice, type VoiceEvents } from "./audio/Voice"
|
|
51
|
+
export { Bus, REVERB_PRESETS, type ReverbPreset, type ReverbParams, type EchoParams } from "./audio/Bus"
|
|
52
|
+
export { audio, type PlaySoundOptions, type SpatialOptions, type Rolloff, type AudioStats } from "./audio/audio"
|
|
53
|
+
export { openFilePicker, files, type FileData } from "./runtime/files"
|
|
54
|
+
export { share } from "./runtime/share"
|
|
55
|
+
export { ClickEvent, TouchStartEvent, LongPressEvent } from "./runtime/touch"
|
|
56
|
+
|
|
57
|
+
// ---- 2D engine (creator-2d) ----
|
|
58
|
+
export { Scene2D } from "./g2/Scene2D"
|
|
59
|
+
export { Node2D } from "./g2/Node2D"
|
|
60
|
+
export { Camera2D } from "./g2/Camera2D"
|
|
61
|
+
export { Sprite } from "./g2/Sprite"
|
|
62
|
+
export { SpriteAnimation } from "./g2/SpriteAnimation"
|
|
63
|
+
export { Shape2D } from "./g2/Shape2D"
|
|
64
|
+
export { Physics2D } from "./g2/Physics2D"
|
|
65
|
+
export { Trigger2D } from "./g2/Trigger2D"
|
|
66
|
+
export { CharacterController2D } from "./g2/CharacterController2D"
|
|
67
|
+
export { OneWay2D } from "./g2/OneWay2D"
|
|
68
|
+
export { PhysicsGroup2D } from "./g2/groups2d"
|
|
69
|
+
export { Tilemap } from "./g2/Tilemap"
|
|
70
|
+
export { Texture2D } from "./g2/Texture2D"
|
|
71
|
+
// sprite sheets as data (.sprite.ts files — see src/g2/SpriteSheet.ts)
|
|
72
|
+
export { SpriteSheet, defineSpriteSheet } from "./g2/SpriteSheet"
|
|
73
|
+
export type { SpriteSheetDef, SheetSprite, SpriteMakeOptions } from "./g2/SpriteSheet"
|
|
74
|
+
// tilesets as data (.tiles.ts files — autotile materials, see src/g2/Tileset.ts + autotile.ts)
|
|
75
|
+
export { Tileset, defineTileset, Autotile2D } from "./g2/Tileset"
|
|
76
|
+
export { rawCell, isRawCell, rawIndex } from "./g2/autotile"
|
|
77
|
+
export { rot90, rot180, rot270, flipX, packTile, tileIndex, tileTurns, tileFlip, tileOriented } from "./g2/autotile"
|
|
78
|
+
export type {
|
|
79
|
+
TilesetDef, TileMaterial, PatchMaterial, PathMaterial, PatchSlots, EdgeSlot, FillBlock, BlockEntry,
|
|
80
|
+
TileBlock, TilePart,
|
|
81
|
+
} from "./g2/autotile"
|
|
82
|
+
// 2D scenes as data (.scene2d.ts files — see src/g2/defineScene2d.ts) + the cells('…') payload
|
|
83
|
+
export { defineScene2d, Scene2dHandle } from "./g2/defineScene2d"
|
|
84
|
+
export type { Scene2dDef, Scene2dNodeDef, Scene2dEnv, SpriteSourceDef, TilemapSourceDef, Camera2dNodeDef, LoadedScene2d } from "./g2/defineScene2d"
|
|
85
|
+
export { cells, encodeCells, type CellsData } from "./g2/cells"
|
|
86
|
+
// no-code 2D scenario aspects (attachable in scene files — see src/g2/scenarios2d.ts)
|
|
87
|
+
export { CameraFollow } from "./g2/scenarios2d"
|
|
88
|
+
|
|
89
|
+
// ---- UI (creator-ui) ----
|
|
90
|
+
export {
|
|
91
|
+
UIScreen, type UIScreenStyle,
|
|
92
|
+
UIRow, UIColumn, UIBox, type UIContainerStyle,
|
|
93
|
+
UIText, type UITextStyle,
|
|
94
|
+
UIButton, type UIButtonStyle,
|
|
95
|
+
UIImage, type UIImageStyle,
|
|
96
|
+
UIVideo, type UIVideoStyle,
|
|
97
|
+
UIInput, UITextArea, type UIInputStyle,
|
|
98
|
+
UIScrollable, type UIScrollableStyle,
|
|
99
|
+
UIPager, type UIPagerStyle,
|
|
100
|
+
UITabs, type UITabDef,
|
|
101
|
+
defineTabs, type TabDef, type TabsHandle,
|
|
102
|
+
UIWidget, type UIWidgetStyle,
|
|
103
|
+
UIModal, type UIModalStyle,
|
|
104
|
+
UIBottomSheet, type UIBottomSheetStyle,
|
|
105
|
+
UIPopover, type UIPopoverStyle,
|
|
106
|
+
UISpacer, type UISpacerStyle,
|
|
107
|
+
UIVirtualizedList,
|
|
108
|
+
Router,
|
|
109
|
+
NativeView, type UINativeViewStyle,
|
|
110
|
+
registerFont,
|
|
111
|
+
__uiMap,
|
|
112
|
+
__UIColumn, __UIRow, __UIBox, __UIButton, __UIScreen, __UIScrollable, __UIWidget,
|
|
113
|
+
} from "./ui/UI"
|
|
114
|
+
// The Presentable navigation contract (docs/navigation-presentable-plan.md). `Presentable` is
|
|
115
|
+
// interface + runtime companion (declaration merging): `Presentable.current` = what's on screen.
|
|
116
|
+
export { Presentable } from "./ui/UI"
|
|
117
|
+
export type { PresentOptions, Transition, TransitionName, TransitionSpec, TransitionTransform } from "./ui/UI"
|
|
118
|
+
// The base node type + the union a container accepts as children — documented as the signature of
|
|
119
|
+
// UIColumn/UIRow/append/etc., so they must be global (type-only; erased at runtime).
|
|
120
|
+
export type { UINode, UINodeChild } from "./ui/UINode"
|
|
121
|
+
// App theme variables (docs/ui-theme-plan.md): theme({...}) merges + returns typed var()
|
|
122
|
+
// accessors; system vars are static props (theme.primaryColor, theme["comfort-top"], …).
|
|
123
|
+
export { theme, type ThemeValues, type ThemeAccessors } from "./ui/theme"
|
|
124
|
+
|
|
125
|
+
// ---- animate ----
|
|
126
|
+
// animate() runs on the keyframe core (a VALUE track) since 2026-09-14: same handle, easing and clocks
|
|
127
|
+
// as animateTo; stop / pause / resume are the handle's methods, a matrix is just a value kind.
|
|
128
|
+
export { animate, type AnimateOptions, type AnimateValue, type AnimateOut } from "./animate/tween/animateValue"
|
|
129
|
+
export { cubicBezier } from "./animate/bezier"
|
|
130
|
+
// Keyframe animation core (docs/timeline-plan.md): the handle `animateTo` / `animateFrom` return,
|
|
131
|
+
// and `Timeline()` — choreography over UI elements, 3D / 2D nodes, lights and cameras.
|
|
132
|
+
export { Timeline, type TimelineOptions, type TimelineAddOptions, type TimelinePosition } from "./animate/tween/Timeline"
|
|
133
|
+
export { type Animation } from "./animate/tween/Animation"
|
|
134
|
+
export { type TweenMeta } from "./animate/tween/spec"
|
|
135
|
+
export { type EasingInput } from "./animate/tween/easing"
|
|
136
|
+
export { easeIn, easeOut, easeInOut } from "./animate/easings"
|
|
137
|
+
|
|
138
|
+
// ---- plugins (optional, host-provided capabilities — typed NativeView/service wrappers, see src/plugins/) ----
|
|
139
|
+
export { QRScanner } from "./plugins/qr"
|
|
140
|
+
export { CameraView, type CameraFacing } from "./plugins/camera"
|
|
141
|
+
export { Geolocation, type GeoPosition, type GeoOptions, type GeoWatch } from "./plugins/geolocation"
|
|
142
|
+
export {
|
|
143
|
+
MapView, type MapOptions, type MapStyle, type MapStyleName, type MapCamera, type MapTap, type LngLat, type CameraMove, type FitOptions,
|
|
144
|
+
type MapPaddingValues, type MarkerItem, type MarkerTap, type MarkerLayer, type MarkerLayerOptions,
|
|
145
|
+
type LineLayer, type LineLayerOptions, type UserLocationOptions,
|
|
146
|
+
} from "./plugins/map"
|
|
147
|
+
export { Push, type PushPayload, type PushStatus, type PushRegisterOptions, type PushEvent } from "./plugins/push"
|
|
148
|
+
export { OAuth, type OAuthCredential, type OAuthProviderName } from "./plugins/oauth"
|
|
149
|
+
export { Service } from "./plugins/service"
|
|
150
|
+
|
|
151
|
+
// ---- scenes as data (.scene.ts files — see src/scene/defineScene.ts) ----
|
|
152
|
+
export { defineScene, use, ref, make, SceneHandle, applyEditorPose as __applyEditorPose } from "./scene/defineScene"
|
|
153
|
+
export {
|
|
154
|
+
defineMaterial, MaterialHandle,
|
|
155
|
+
// editor-harness helpers (the scene editor's live material paths — not app API)
|
|
156
|
+
assignMaterialDef as __assignMaterialDef, applyMaterialParam as __applyMaterialParam,
|
|
157
|
+
} from "./scene/material"
|
|
158
|
+
export type { MaterialData, MaterialParamValue, ShaderMaterialDef, LitMaterialDef, UnlitMaterialDef } from "./scene/material"
|
|
159
|
+
export type { SceneDef, SceneNodeDef, MeshDef, LightDef, MaterialDef, CameraNodeDef, AspectEntry, MakeEntry, LoadedScene, SceneInstance } from "./scene/defineScene"
|
|
160
|
+
export { CameraPlace } from "./gl/CameraPlace"
|
|
161
|
+
// Procedural placement for large maps (line/grid/ring/scatter/place) — built for make() factories.
|
|
162
|
+
export { Level } from "./scene/level"
|
|
163
|
+
export type { LevelSpot, LevelBuild, LevelCollider, LevelLineOptions, LevelGridOptions, LevelRingOptions, LevelScatterOptions, LevelPlaceOptions } from "./scene/level"
|
|
164
|
+
export type { FieldMeta } from "./core/fields"
|
|
165
|
+
// Editor-only line drawing from generator rebuild() / make() factories / tool hooks — drawn by the
|
|
166
|
+
// scene editor's viewport overlay, a no-op everywhere else (see src/scene/gizmos.ts).
|
|
167
|
+
export { Gizmos, GizmoBuffer as __GizmoBuffer, withGizmoScope as __withGizmoScope } from "./scene/gizmos"
|
|
168
|
+
export type { GizmoStyle, GizmoAnchor } from "./scene/gizmos"
|
|
169
|
+
|
|
170
|
+
// ---- no-code scenario aspects (attachable in the scene editor — see src/gl/scenarios.ts) ----
|
|
171
|
+
export { MoveTo, FollowPath, Spin, LookAt, PlayAnimation } from "./gl/scenarios"
|
|
172
|
+
|
|
173
|
+
// ---- editor plugins (called from `*.editor.ts` files — editor bundles only; DCE'd from apps) ----
|
|
174
|
+
export { registerEditorWindow, registerEditorTool, __editorPlugins } from "./scene/editorPlugins"
|
|
175
|
+
export type { EditorApi, EditorRayHit, EditorToolHooks, EditorWindowFn } from "./scene/editorPlugins"
|
|
176
|
+
|
|
177
|
+
// ---- 3D engine (creator-gl) ----
|
|
178
|
+
export { Scene, ARScene, VRScene } from "./gl/Scene"
|
|
179
|
+
export { Node } from "./gl/Node"
|
|
180
|
+
export { Mesh } from "./gl/Mesh"
|
|
181
|
+
export { Model } from "./gl/Model"
|
|
182
|
+
export { Shape } from "./gl/physics/Shape"
|
|
183
|
+
export { Physics } from "./gl/physics/Physics"
|
|
184
|
+
export { Trigger } from "./gl/physics/Trigger"
|
|
185
|
+
export { AudioSource, type AudioCone } from "./gl/audio/AudioSource"
|
|
186
|
+
export { AudioZone } from "./gl/audio/AudioZone"
|
|
187
|
+
export { SceneAudio } from "./gl/audio/SceneAudio"
|
|
188
|
+
export { CharacterController } from "./gl/physics/CharacterController"
|
|
189
|
+
export { Vehicle } from "./gl/vehicle/Vehicle"
|
|
190
|
+
export type { DriveLayout, DifferentialMode, EngineConfig, SteeringConfig, SteeringFeedback, SteeringDriver, AeroConfig } from "./gl/vehicle/Vehicle"
|
|
191
|
+
export { Wheel, Tire, resolveTire } from "./gl/vehicle/Wheel"
|
|
192
|
+
export { Ragdoll } from "./gl/physics/Ragdoll"
|
|
193
|
+
export type { RagdollPart, RagdollHinge, RagdollFacing, RagdollActivateOptions, RagdollDeactivateOptions, RagdollHitOptions } from "./gl/physics/Ragdoll"
|
|
194
|
+
export type { Point, WheelSuspension } from "./gl/vehicle/Wheel"
|
|
195
|
+
export { AnimationClip } from "./gl/animation/AnimationClip"
|
|
196
|
+
export type { ClipDef, ClipTrackDef, ClipKey } from "./gl/animation/AnimationClip"
|
|
197
|
+
export { Animator } from "./gl/animation/Animator"
|
|
198
|
+
export type { LodMode } from "./gl/animation/Animator"
|
|
199
|
+
export type { TrianglePick } from "./gl/Model"
|
|
200
|
+
export { Feet } from "./gl/animation/Feet"
|
|
201
|
+
export type { FeetOptions, FootState } from "./gl/animation/Feet"
|
|
202
|
+
export { Warp } from "./gl/animation/Warp"
|
|
203
|
+
export type { WarpOptions, StepWarpOptions } from "./gl/animation/Warp"
|
|
204
|
+
export { Playback } from "./gl/animation/Playback"
|
|
205
|
+
export { Loop } from "./gl/animation/Loop"
|
|
206
|
+
export { Layer } from "./gl/animation/Layer"
|
|
207
|
+
export type { PlayOptions, StopOptions, LayerOptions, LoopOptions, LoopDef, BlendPosition, BlendMember, ActiveClip, ClipInfo, ClipCycle, ClipAlign, KneeAxisReport, StepHandler, ClipEventHandler } from "./gl/animation/core"
|
|
208
|
+
export { IK } from "./gl/animation/IK"
|
|
209
|
+
export { DynamicBone, DynamicBoneCollider } from "./gl/animation/DynamicBone"
|
|
210
|
+
export type { DynamicBoneCurve, DynamicBoneFloor, DynamicBoneColliders } from "./gl/animation/DynamicBone"
|
|
211
|
+
export type { IKTwoBone, IKLookAt } from "./gl/animation/IK"
|
|
212
|
+
export { Light } from "./gl/Light"
|
|
213
|
+
export { Lightmap } from "./gl/Lightmap"
|
|
214
|
+
export { Foliage } from "./gl/Foliage"
|
|
215
|
+
export type { FoliageOptions, FoliageWind } from "./gl/Foliage"
|
|
216
|
+
export { Terrain } from "./gl/terrain/Terrain"
|
|
217
|
+
export type { TerrainOptions, TerrainLayer, TerrainRegion, ConformOptions, RibbonOptions, AutoPaintRules, SculptOptions, TerrainHit, TerrainSnapshot } from "./gl/terrain/Terrain"
|
|
218
|
+
export { NavMesh, NavCrowd } from "./gl/nav/NavMesh"
|
|
219
|
+
export type { NavMeshLoadOptions, NavMeshInfo, NavPath, NavQueryOptions, NavRaycastHit, NavAgentSize } from "./gl/nav/NavMesh"
|
|
220
|
+
export { NavAgent } from "./gl/nav/NavAgent"
|
|
221
|
+
export type { NavAgentState, NavAgentAvoidance, NavAgentDrive, NavAgentEvents } from "./gl/nav/NavAgent"
|
|
222
|
+
export { Locomotion } from "./gl/animation/Locomotion"
|
|
223
|
+
export type { LocomotionSet, LocomotionClip, LocomotionTuning, LocomotionState, LocomotionEvents, Displacement, Gait } from "./gl/animation/Locomotion"
|
|
224
|
+
export { Material } from "./gl/Material"
|
|
225
|
+
export { Geometry } from "./gl/Geometry"
|
|
226
|
+
export { InstancedMesh } from "./gl/InstancedMesh"
|
|
227
|
+
export type { InstanceTransform } from "./gl/InstancedMesh"
|
|
228
|
+
export { Texture } from "./gl/Texture"
|
|
229
|
+
export type { TextureLoadOptions } from "./gl/Texture"
|
|
230
|
+
export { Camera } from "./gl/Camera"
|
|
231
|
+
export { Ray } from "./gl/Ray"
|
|
232
|
+
export { Plane } from "./gl/Plane"
|
|
233
|
+
export { Noise } from "./gl/Noise"
|
|
234
|
+
export { Particles, Trail, curve, colorCurve } from "./gl/Particles"
|
|
235
|
+
export { DecalSet, DecalTrail } from "./gl/DecalSet"
|
|
236
|
+
export type { DecalOptions, DecalSetOptions, DecalSpawnOptions, DecalPlacement, DecalTrailOptions } from "./gl/DecalSet"
|
package/src/runtime/input.ts
CHANGED
|
@@ -117,6 +117,13 @@ export interface GamepadState {
|
|
|
117
117
|
axis(name: GamepadAxisName, deadzone?: number): number
|
|
118
118
|
/** Held? Same as `Input.key(code, index)`. */
|
|
119
119
|
button(code: string): boolean
|
|
120
|
+
/** Rumble: `strong` = the heavy low-frequency motor, `weak` = the light high-frequency one, both
|
|
121
|
+
* 0..1, for `durationMs` (default 200, hosts cap at 5000). A new call replaces the running
|
|
122
|
+
* effect. The host stops the motors by itself — after the duration, on focus loss and when the
|
|
123
|
+
* project is swapped — so there is nothing to clean up. False when the pad or host has no motors. */
|
|
124
|
+
rumble(strong: number, weak?: number, durationMs?: number): boolean
|
|
125
|
+
/** Stop the running rumble now. */
|
|
126
|
+
stopRumble(): void
|
|
120
127
|
}
|
|
121
128
|
|
|
122
129
|
const padCache: GamepadState[] = []
|
|
@@ -132,6 +139,10 @@ const gamepadAt = (index: number): GamepadState => {
|
|
|
132
139
|
return deadzone > 0 && Math.abs(v) < deadzone ? 0 : v
|
|
133
140
|
},
|
|
134
141
|
button(code) { return _creatorUtils.inputKey(code, index) },
|
|
142
|
+
rumble(strong, weak = strong, durationMs = 200) {
|
|
143
|
+
return _creatorUtils.inputRumble?.(index, strong, weak, durationMs) ?? false
|
|
144
|
+
},
|
|
145
|
+
stopRumble() { _creatorUtils.inputRumble?.(index, 0, 0, 0) },
|
|
135
146
|
}
|
|
136
147
|
}
|
|
137
148
|
return g
|