Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

chore(api): record UIController/UIGear public surface

yhh80aa781c2b21
diff --git a/sdk/etc/index.api.md b/sdk/etc/index.api.md
index 7b5cc8ef5..50334e225 100644
--- a/sdk/etc/index.api.md
+++ b/sdk/etc/index.api.md
@@ -1,7 +1,7 @@
# API surface — esengine/index
<!-- Generated by tools/api-surface.mjs — do not edit. Run --update to accept changes. -->
-Symbols: 1187 stable · 17 beta · 1 deprecated
+Symbols: 1203 stable · 17 beta · 1 deprecated
## ABI_LAYOUT_HASH — const
```
@@ -1521,6 +1521,13 @@ thresholdDb: number | undefined
type: "compressor"
```
+## ControllerState — interface
+```
+current: string
+name: string
+pages: string[]
+```
+
## CookedAtlasInfo — interface
```
frame: { x: number; y: number; width: number; height: number; }
@@ -2764,6 +2771,26 @@ index: number
mapping: string
```
+## GearBinding — interface
+```
+component: string
+controller: string
+pages: Record<string, GearValue>
+property: string
+tween: GearTween | undefined
+```
+
+## GearTween — interface
+```
+duration: number
+easing: EasingType
+```
+
+## GearValue — type
+```
+number | boolean | string | Color | Vec2 | Vec3
+```
+
## Geometry — const
```
{ create(options: GeometryOptions): GeometryHandle; updateVertices(handle: GeometryHandle, vertices: Float32Array, offset?: number): void; release(handle: GeometryHandle): void; isValid(handle: GeometryHandle): boolean; createQuad(width?: number, height?: number): GeometryHandle; createCircle(radius?: number, segments?: number): GeometryHandle; createPolygon(points: Array<{ x: number; y: number; }>): GeometryHandle; }
@@ -2891,6 +2918,16 @@ sideModules: SideModuleHost | undefined
| { type: 'polygon'; points: number[] }
```
+## INTERACTION_CONTROLLER — const
+```
+"$interaction"
+```
+
+## INTERACTION_PAGES — const
+```
+readonly ["normal", "hover", "pressed", "disabled"]
+```
+
## INVALID_ENTITY — const
```
number
@@ -6810,6 +6847,16 @@ worldTop: number
ResourceDef<UICameraData>
```
+## UIController — const
+```
+ComponentDef<UIControllerData>
+```
+
+## UIControllerData — interface
+```
+controllers: ControllerState[]
+```
+
## UIEntityInit — interface
```
node: UINodeInit | undefined
@@ -6859,6 +6906,16 @@ typeof UIEventType[keyof typeof UIEventType]
ResourceDef<UIEventQueue>
```
+## UIGear — const
+```
+ComponentDef<UIGearData>
+```
+
+## UIGearData — interface
+```
+bindings: GearBinding[]
+```
+
## UIInteraction — const
```
BuiltinComponentDef<UIInteractionData>
@@ -7654,6 +7711,11 @@ BtPlugin
(data: Uint8Array | string): string
```
+## controllerState — function
+```
+(name: string, pages: string[], current?: string): ControllerState
+```
+
## corePlugin — const
```
Plugin
@@ -7924,6 +7986,11 @@ DragPlugin
(z: number, w: number): number
```
+## findControllerOwner — function
+```
+(world: World, entity: Entity, name: string): Entity | null
+```
+
## findEntityByName — function
```
(world: World, name: string): Entity | null
@@ -7984,6 +8051,11 @@ FsmPlugin
(): boolean
```
+## gearBinding — function
+```
+(controller: string, component: string, property: string, pages: Record<string, GearValue>, tween?: GearTween): GearBinding
+```
+
## getAddressableType — function
```
(path: string): AddressableAssetType | null
@@ -8069,6 +8141,11 @@ FsmPlugin
(componentType: string): { skeletonField: string; atlasField: string; } | null
```
+## getControllerPage — function
+```
+(world: World, entity: Entity, name: string): string | null
+```
+
## getCustomExtensions — function
```
(): string[]
@@ -8254,6 +8331,11 @@ InputRouter
(world: World, prefab: PrefabData, options?: InstantiatePrefabOptions): Promise<InstantiatePrefabResult>
```
+## interactionController — function
+```
+(pages?: string[]): ControllerState
+```
+
## interpolate — function
```
(template: string, params?: TParams): string
@@ -8924,6 +9006,11 @@ Plugin
(entityId: number, cache: BitmapCache): void
```
+## setControllerPage — function
+```
+(world: World, entity: Entity, name: string, page: string): boolean
+```
+
## setDefaultContext — function
```
(ctx: AppContext): void
diff --git a/sdk/etc/index.node.api.md b/sdk/etc/index.node.api.md
index af0cbfb44..c4f6e14d2 100644
--- a/sdk/etc/index.node.api.md
+++ b/sdk/etc/index.node.api.md
@@ -1,7 +1,7 @@
# API surface — esengine/index.node
<!-- Generated by tools/api-surface.mjs — do not edit. Run --update to accept changes. -->
-Symbols: 1186 stable · 19 beta · 1 deprecated
+Symbols: 1202 stable · 19 beta · 1 deprecated
## ANCHOR_AXES — const
```
@@ -1516,6 +1516,13 @@ thresholdDb: number | undefined
type: "compressor"
```
+## ControllerState — interface
+```
+current: string
+name: string
+pages: string[]
+```
+
## CookedAtlasInfo — interface
```
frame: { x: number; y: number; width: number; height: number; }
@@ -2759,6 +2766,26 @@ index: number
mapping: string
```
+## GearBinding — interface
+```
+component: string
+controller: string
+pages: Record<string, GearValue>
+property: string
+tween: GearTween | undefined
+```
+
+## GearTween — interface
+```
+duration: number
+easing: EasingType
+```
+
+## GearValue — type
+```
+number | boolean | string | Color | Vec2 | Vec3
+```
+
## Geometry — const
```
{ create(options: GeometryOptions): GeometryHandle; updateVertices(handle: GeometryHandle, vertices: Float32Array, offset?: number): void; release(handle: GeometryHandle): void; isValid(handle: GeometryHandle): boolean; createQuad(width?: number, height?: number): GeometryHandle; createCircle(radius?: number, segments?: number): GeometryHandle; createPolygon(points: Array<{ x: number; y: number; }>): GeometryHandle; }
@@ -2886,6 +2913,16 @@ sideModules: SideModuleHost | undefined
| { type: 'polygon'; points: number[] }
```
+## INTERACTION_CONTROLLER — const
+```
+"$interaction"
+```
+
+## INTERACTION_PAGES — const
+```
+readonly ["normal", "hover", "pressed", "disabled"]
+```
+
## INVALID_ENTITY — const
```
number
@@ -6805,6 +6842,16 @@ worldTop: number
ResourceDef<UICameraData>
```
+## UIController — const
+```
+ComponentDef<UIControllerData>
+```
+
+## UIControllerData — interface
+```
+controllers: ControllerState[]
+```
+
## UIEntityInit — interface
```
node: UINodeInit | undefined
@@ -6854,6 +6901,16 @@ typeof UIEventType[keyof typeof UIEventType]
ResourceDef<UIEventQueue>
```
+## UIGear — const
+```
+ComponentDef<UIGearData>
+```
+
+## UIGearData — interface
+```
+bindings: GearBinding[]
+```
+
## UIInteraction — const
```
BuiltinComponentDef<UIInteractionData>
@@ -7649,6 +7706,11 @@ BtPlugin
(data: Uint8Array | string): string
```
+## controllerState — function
+```
+(name: string, pages: string[], current?: string): ControllerState
+```
+
## corePlugin — const
```
Plugin
@@ -7919,6 +7981,11 @@ DragPlugin
(z: number, w: number): number
```
+## findControllerOwner — function
+```
+(world: World, entity: Entity, name: string): Entity | null
+```
+
## findEntityByName — function
```
(world: World, name: string): Entity | null
@@ -7979,6 +8046,11 @@ FsmPlugin
(): boolean
```
+## gearBinding — function
+```
+(controller: string, component: string, property: string, pages: Record<string, GearValue>, tween?: GearTween): GearBinding
+```
+
## getAddressableType — function
```
(path: string): AddressableAssetType | null
@@ -8064,6 +8136,11 @@ FsmPlugin
(componentType: string): { skeletonField: string; atlasField: string; } | null
```
+## getControllerPage — function
+```
+(world: World, entity: Entity, name: string): string | null
+```
+
## getCustomExtensions — function
```
(): string[]
@@ -8249,6 +8326,11 @@ InputRouter
(world: World, prefab: PrefabData, options?: InstantiatePrefabOptions): Promise<InstantiatePrefabResult>
```
+## interactionController — function
+```
+(pages?: string[]): ControllerState
+```
+
## interpolate — function
```
(template: string, params?: TParams): string
@@ -8929,6 +9011,11 @@ Plugin
(entityId: number, cache: BitmapCache): void
```
+## setControllerPage — function
+```
+(world: World, entity: Entity, name: string, page: string): boolean
+```
+
## setDefaultContext — function
```
(ctx: AppContext): void