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.

fix: correct documentation API errors and default values

esengine903ef55be2c9
diff --git a/docs/astro/src/content/docs/changelog.mdx b/docs/astro/src/content/docs/changelog.mdx
index 7991bce09..7d25f8518 100644
--- a/docs/astro/src/content/docs/changelog.mdx
+++ b/docs/astro/src/content/docs/changelog.mdx
@@ -22,7 +22,7 @@ import { Aside } from '@astrojs/starlight/components';
- Spine runtime is no longer bundled in the engine core
- Standalone WASM modules `spine38` and `spine42` are loaded on demand via `SpinePlugin`
-- Choose the runtime version matching your Spine editor export (`3.8` or `4.2`)
+- Select the runtime version in **Settings → Project → Spine Version** (`3.8` or `4.2`)
## Embedded Assets (Playable Builds)
diff --git a/docs/astro/src/content/docs/guides/assets.mdx b/docs/astro/src/content/docs/guides/assets.mdx
index 87cdee593..af42554fe 100644
--- a/docs/astro/src/content/docs/guides/assets.mdx
+++ b/docs/astro/src/content/docs/guides/assets.mdx
@@ -171,13 +171,13 @@ For Playable Ad builds, assets can be embedded directly into the output bundle u
```typescript
import { registerEmbeddedAssets } from 'esengine';
-registerEmbeddedAssets({
- 'assets/player.png': 'data:image/png;base64,iVBOR...',
- 'assets/config.json': '{"level":1}',
+registerEmbeddedAssets(app, {
+ 'sprites/player.png': 'data:image/png;base64,iVBOR...',
+ 'data/config.json': 'data:application/json;base64,eyJsZXZlbCI6MX0=',
});
```
-Once registered, all `assets.loadTexture()` / `assets.loadJson()` calls resolve from the embedded data instead of fetching over the network.
+The first argument is the `App` instance. Asset values must be data URIs. Once registered, all `assets.loadTexture()` / `assets.loadJson()` calls resolve from the embedded data instead of fetching over the network.
<Aside type="tip">
The editor's Playable build pipeline calls `registerEmbeddedAssets` automatically. You only need to call it manually in custom build workflows.
diff --git a/docs/astro/src/content/docs/guides/canvas.mdx b/docs/astro/src/content/docs/guides/canvas.mdx
index a4ea4858d..92d4be548 100644
--- a/docs/astro/src/content/docs/guides/canvas.mdx
+++ b/docs/astro/src/content/docs/guides/canvas.mdx
@@ -17,9 +17,9 @@ You can also add the `Canvas` component manually to any entity that has a `Camer
| Property | Type | Default | Description |
|----------|------|---------|-------------|
-| `designResolution` | Vec2 | `{x: 1280, y: 720}` | The reference resolution you design your game for |
+| `designResolution` | Vec2 | `{x: 1920, y: 1080}` | The reference resolution you design your game for |
| `pixelsPerUnit` | number | `100` | How many pixels equal one world unit |
-| `scaleMode` | number | `0` | Scale strategy (see below) |
+| `scaleMode` | number | `1` | Scale strategy (see below) |
| `matchWidthOrHeight` | number | `0.5` | Blend factor for Match mode (0 = width, 1 = height) |
| `backgroundColor` | Vec4 | `{x: 0, y: 0, z: 0, w: 1}` | Letterbox/pillarbox fill color |
diff --git a/docs/astro/src/content/docs/guides/rendering.mdx b/docs/astro/src/content/docs/guides/rendering.mdx
index 4ee44501b..4bd7c0c79 100644
--- a/docs/astro/src/content/docs/guides/rendering.mdx
+++ b/docs/astro/src/content/docs/guides/rendering.mdx
@@ -23,6 +23,7 @@ A `Camera` component is required to see anything. The editor's default scene alr
| `nearPlane` | number | Near clipping plane |
| `farPlane` | number | Far clipping plane |
| `isActive` | boolean | Whether this camera is used for rendering |
+| `aspectRatio` | number | Camera aspect ratio |
| `priority` | number | Higher priority camera takes precedence |
| `showFrustum` | boolean | Draw the camera frustum wireframe in the editor |
diff --git a/docs/astro/src/content/docs/guides/spine.mdx b/docs/astro/src/content/docs/guides/spine.mdx
index c1fc23cf8..19c8c0945 100644
--- a/docs/astro/src/content/docs/guides/spine.mdx
+++ b/docs/astro/src/content/docs/guides/spine.mdx
@@ -8,21 +8,9 @@ import { Aside } from '@astrojs/starlight/components';
The `SpineAnimation` component plays [Spine](http://esotericsoftware.com/) skeletal animations. Add it to an entity in the scene editor along with `LocalTransform`.
<Aside type="note">
- Since v0.3.0, Spine uses standalone WASM modules (`spine38` / `spine42`) instead of being bundled into the engine core. You must register a Spine plugin before using Spine components.
+ Since v0.3.0, Spine uses standalone WASM modules (`spine38` / `spine42`) instead of being bundled into the engine core. Select the Spine version in the editor under **Settings → Project → Spine Version** (`3.8` or `4.2`). The editor loads the matching runtime automatically — no code is needed.
</Aside>
-## Spine Plugin Setup
-
-Initialize the Spine plugin at startup to load the appropriate runtime version:
-
-```typescript
-import { addPlugin, SpinePlugin } from 'esengine';
-
-addPlugin(SpinePlugin({ version: '4.2' }));
-```
-
-`SpinePlugin` accepts `'3.8'` or `'4.2'` to match your Spine editor export version. The plugin downloads the corresponding WASM module on first use.
-
## Properties
| Property | Type | Default | Description |
diff --git a/docs/astro/src/content/docs/zh/changelog.mdx b/docs/astro/src/content/docs/zh/changelog.mdx
index 087fb6ebc..48fcd7c07 100644
--- a/docs/astro/src/content/docs/zh/changelog.mdx
+++ b/docs/astro/src/content/docs/zh/changelog.mdx
@@ -22,7 +22,7 @@ import { Aside } from '@astrojs/starlight/components';
- Spine 运行时不再内置于引擎核心
- 独立 WASM 模块 `spine38` 和 `spine42` 通过 `SpinePlugin` 按需加载
-- 选择与 Spine 编辑器导出版本匹配的运行时(`3.8` 或 `4.2`)
+- 在 **Settings → Project → Spine Version** 中选择运行时版本(`3.8` 或 `4.2`)
## 嵌入式资源(Playable 构建)
diff --git a/docs/astro/src/content/docs/zh/guides/assets.mdx b/docs/astro/src/content/docs/zh/guides/assets.mdx
index 1e438b9fd..46472ac39 100644
--- a/docs/astro/src/content/docs/zh/guides/assets.mdx
+++ b/docs/astro/src/content/docs/zh/guides/assets.mdx
@@ -171,13 +171,13 @@ const tex = await assets.loadTexture('sprites/player.png');
```typescript
import { registerEmbeddedAssets } from 'esengine';
-registerEmbeddedAssets({
- 'assets/player.png': 'data:image/png;base64,iVBOR...',
- 'assets/config.json': '{"level":1}',
+registerEmbeddedAssets(app, {
+ 'sprites/player.png': 'data:image/png;base64,iVBOR...',
+ 'data/config.json': 'data:application/json;base64,eyJsZXZlbCI6MX0=',
});
```
-注册后,所有 `assets.loadTexture()` / `assets.loadJson()` 调用将从嵌入数据解析,不再发起网络请求。
+第一个参数是 `App` 实例,资源值必须是 data URI。注册后,所有 `assets.loadTexture()` / `assets.loadJson()` 调用将从嵌入数据解析,不再发起网络请求。
<Aside type="tip">
编辑器的 Playable 构建流程会自动调用 `registerEmbeddedAssets`。仅在自定义构建流程中才需要手动调用。
diff --git a/docs/astro/src/content/docs/zh/guides/canvas.mdx b/docs/astro/src/content/docs/zh/guides/canvas.mdx
index 7eaee75b4..199b52e68 100644
--- a/docs/astro/src/content/docs/zh/guides/canvas.mdx
+++ b/docs/astro/src/content/docs/zh/guides/canvas.mdx
@@ -17,9 +17,9 @@ import { Aside } from '@astrojs/starlight/components';
| 属性 | 类型 | 默认值 | 说明 |
|------|------|--------|------|
-| `designResolution` | Vec2 | `{x: 1280, y: 720}` | 游戏设计基准分辨率 |
+| `designResolution` | Vec2 | `{x: 1920, y: 1080}` | 游戏设计基准分辨率 |
| `pixelsPerUnit` | number | `100` | 多少像素等于一个世界单位 |
-| `scaleMode` | number | `0` | 缩放策略(见下文) |
+| `scaleMode` | number | `1` | 缩放策略(见下文) |
| `matchWidthOrHeight` | number | `0.5` | Match 模式的混合系数(0 = 宽度,1 = 高度) |
| `backgroundColor` | Vec4 | `{x: 0, y: 0, z: 0, w: 1}` | 黑边填充颜色 |
diff --git a/docs/astro/src/content/docs/zh/guides/rendering.mdx b/docs/astro/src/content/docs/zh/guides/rendering.mdx
index e0bbd2dd7..cf79d3b0d 100644
--- a/docs/astro/src/content/docs/zh/guides/rendering.mdx
+++ b/docs/astro/src/content/docs/zh/guides/rendering.mdx
@@ -23,6 +23,7 @@ ESEngine 使用基于组件的渲染系统。在场景编辑器中为实体添
| `nearPlane` | number | 近裁剪面 |
| `farPlane` | number | 远裁剪面 |
| `isActive` | boolean | 是否用于渲染 |
+| `aspectRatio` | number | 相机宽高比 |
| `priority` | number | 高优先级相机优先 |
| `showFrustum` | boolean | 在编辑器中显示相机视锥线框 |
diff --git a/docs/astro/src/content/docs/zh/guides/spine.mdx b/docs/astro/src/content/docs/zh/guides/spine.mdx
index ae26dc03b..df6e72142 100644
--- a/docs/astro/src/content/docs/zh/guides/spine.mdx
+++ b/docs/astro/src/content/docs/zh/guides/spine.mdx
@@ -8,21 +8,9 @@ import { Aside } from '@astrojs/starlight/components';
`SpineAnimation` 组件播放 [Spine](http://esotericsoftware.com/) 骨骼动画。在场景编辑器中将它和 `LocalTransform` 一起添加到实体上。
<Aside type="note">
- 从 v0.3.0 起,Spine 使用独立的 WASM 模块(`spine38` / `spine42`),不再内置于引擎核心。使用 Spine 组件前必须注册 Spine 插件。
+ 从 v0.3.0 起,Spine 使用独立的 WASM 模块(`spine38` / `spine42`),不再内置于引擎核心。在编辑器中通过 **Settings → Project → Spine Version** 选择版本(`3.8` 或 `4.2`),编辑器会自动加载对应的运行时,无需编写代码。
</Aside>
-## Spine 插件设置
-
-在启动时初始化 Spine 插件以加载对应的运行时版本:
-
-```typescript
-import { addPlugin, SpinePlugin } from 'esengine';
-
-addPlugin(SpinePlugin({ version: '4.2' }));
-```
-
-`SpinePlugin` 接受 `'3.8'` 或 `'4.2'`,需与 Spine 编辑器导出版本匹配。插件会在首次使用时下载对应的 WASM 模块。
-
## 属性
| 属性 | 类型 | 默认值 | 说明 |