@waica/cli 0.7.0 → 0.8.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/README.md +1 -1
- package/dist/editor/assets/{cssMode-eS4pAOyh.js → cssMode-DwPoqXFO.js} +1 -1
- package/dist/editor/assets/{freemarker2-FMQjZKQk.js → freemarker2-gl5y25bH.js} +1 -1
- package/dist/editor/assets/{handlebars-dDYOnqat.js → handlebars-DHUb8mb3.js} +1 -1
- package/dist/editor/assets/{html-Ba6xZh4T.js → html-C8W-psr4.js} +1 -1
- package/dist/editor/assets/{htmlMode-DC9qJr2p.js → htmlMode-BiF5TH2_.js} +1 -1
- package/dist/editor/assets/{index-Cy5pmBhN.css → index-CzarIYLW.css} +1 -1
- package/dist/editor/assets/{index-CoyeInOT.js → index-DtMwWp8R.js} +2732 -608
- package/dist/editor/assets/{javascript-DOwFvmvM.js → javascript-D_t2jyWi.js} +1 -1
- package/dist/editor/assets/{jsonMode-CcG7zlSf.js → jsonMode-CZ0SltDj.js} +1 -1
- package/dist/editor/assets/{liquid-Dfp71r7J.js → liquid-DUxURZui.js} +1 -1
- package/dist/editor/assets/{mdx-Ci7vVeht.js → mdx-CDIQ7hmo.js} +1 -1
- package/dist/editor/assets/{python-Bluv3Y9Q.js → python-Cra2N916.js} +1 -1
- package/dist/editor/assets/{razor-BtwTXMaK.js → razor-B3qV-mNp.js} +1 -1
- package/dist/editor/assets/{tsMode-D3_D-H85.js → tsMode-Ci457z4v.js} +1 -1
- package/dist/editor/assets/{typescript-Ch_PS5f7.js → typescript-BXjh3GLT.js} +1 -1
- package/dist/editor/assets/{xml-CI_bH_MX.js → xml-DQuEpqk5.js} +1 -1
- package/dist/editor/assets/{yaml-LD9GTZyy.js → yaml-CQA7WIT-.js} +1 -1
- package/dist/editor/index.html +2 -2
- package/dist/mcp/known-archetypes.js +5 -0
- package/dist/mcp/node_modules/@waica/archetype-isometric/assets/ATTRIBUTION.md +72 -0
- package/dist/mcp/node_modules/@waica/archetype-isometric/assets/waica-iso-crate.png +0 -0
- package/dist/mcp/node_modules/@waica/archetype-isometric/assets/waica-iso-ground.png +0 -0
- package/dist/mcp/node_modules/@waica/archetype-isometric/assets/waica-iso-hero.png +0 -0
- package/dist/mcp/node_modules/@waica/archetype-isometric/assets/waica-iso-orc.png +0 -0
- package/dist/mcp/node_modules/@waica/archetype-isometric/assets/waica-iso-rock.png +0 -0
- package/dist/mcp/node_modules/@waica/archetype-isometric/assets/waica-iso-tree.png +0 -0
- package/dist/mcp/node_modules/@waica/archetype-isometric/assets/waica-iso-villager.png +0 -0
- package/dist/mcp/node_modules/@waica/archetype-isometric/dist/animation.d.ts +3 -0
- package/dist/mcp/node_modules/@waica/archetype-isometric/dist/animation.js +10 -0
- package/dist/mcp/node_modules/@waica/archetype-isometric/dist/art.d.ts +3 -0
- package/dist/mcp/node_modules/@waica/archetype-isometric/dist/art.js +10 -0
- package/dist/mcp/node_modules/@waica/archetype-isometric/dist/bundle.d.ts +2 -0
- package/dist/mcp/node_modules/@waica/archetype-isometric/dist/bundle.js +9 -0
- package/dist/mcp/node_modules/@waica/archetype-isometric/dist/controls.d.ts +3 -0
- package/dist/mcp/node_modules/@waica/archetype-isometric/dist/controls.js +14 -0
- package/dist/mcp/node_modules/@waica/archetype-isometric/dist/index.d.ts +24 -0
- package/dist/mcp/node_modules/@waica/archetype-isometric/dist/index.js +15 -0
- package/dist/mcp/node_modules/@waica/archetype-isometric/dist/manifest.d.ts +16 -0
- package/dist/mcp/node_modules/@waica/archetype-isometric/dist/manifest.js +29 -0
- package/dist/mcp/node_modules/@waica/archetype-isometric/dist/prefabs.d.ts +18 -0
- package/dist/mcp/node_modules/@waica/archetype-isometric/dist/prefabs.js +196 -0
- package/dist/mcp/node_modules/@waica/archetype-isometric/dist/registry-data.d.ts +3 -0
- package/dist/mcp/node_modules/@waica/archetype-isometric/dist/registry-data.js +46 -0
- package/dist/mcp/node_modules/@waica/archetype-isometric/dist/registry.d.ts +4 -0
- package/dist/mcp/node_modules/@waica/archetype-isometric/dist/registry.js +17 -0
- package/dist/mcp/node_modules/@waica/archetype-isometric/dist/scene-default.d.ts +5 -0
- package/dist/mcp/node_modules/@waica/archetype-isometric/dist/scene-default.js +49 -0
- package/dist/mcp/node_modules/@waica/archetype-isometric/dist/ui.d.ts +1 -0
- package/dist/mcp/node_modules/@waica/archetype-isometric/dist/ui.js +17 -0
- package/dist/mcp/node_modules/@waica/archetype-isometric/package.json +30 -0
- package/dist/mcp/node_modules/@waica/archetype-platformer/package.json +3 -3
- package/dist/mcp/node_modules/@waica/archetype-topdown/dist/registry-data.js +2 -1
- package/dist/mcp/node_modules/@waica/archetype-topdown/dist/ui.js +2 -19
- package/dist/mcp/node_modules/@waica/archetype-topdown/package.json +3 -3
- package/dist/mcp/node_modules/@waica/behaviors/dist/grid-motor.d.ts +56 -0
- package/dist/mcp/node_modules/@waica/behaviors/dist/grid-motor.js +74 -0
- package/dist/mcp/node_modules/@waica/behaviors/dist/grid-player-role.d.ts +15 -0
- package/dist/mcp/node_modules/@waica/behaviors/dist/grid-player-role.js +71 -0
- package/dist/mcp/node_modules/@waica/behaviors/dist/index.d.ts +3 -1
- package/dist/mcp/node_modules/@waica/behaviors/dist/index.js +3 -1
- package/dist/mcp/node_modules/@waica/behaviors/dist/interactable.d.ts +3 -0
- package/dist/mcp/node_modules/@waica/behaviors/dist/interactable.js +25 -2
- package/dist/mcp/node_modules/@waica/behaviors/dist/iso-motor.d.ts +14 -0
- package/dist/mcp/node_modules/@waica/behaviors/dist/iso-motor.js +36 -0
- package/dist/mcp/node_modules/@waica/behaviors/dist/iso-player-states.d.ts +5 -0
- package/dist/mcp/node_modules/@waica/behaviors/dist/iso-player-states.js +9 -0
- package/dist/mcp/node_modules/@waica/behaviors/dist/topdown-motor.d.ts +7 -61
- package/dist/mcp/node_modules/@waica/behaviors/dist/topdown-motor.js +8 -79
- package/dist/mcp/node_modules/@waica/behaviors/dist/topdown-player-states.d.ts +4 -17
- package/dist/mcp/node_modules/@waica/behaviors/dist/topdown-player-states.js +10 -82
- package/dist/mcp/node_modules/@waica/behaviors/package.json +2 -2
- package/dist/mcp/node_modules/@waica/engine/dist/component.d.ts +2 -0
- package/dist/mcp/node_modules/@waica/engine/dist/components/animated-sprite.d.ts +19 -1
- package/dist/mcp/node_modules/@waica/engine/dist/components/animated-sprite.js +35 -7
- package/dist/mcp/node_modules/@waica/engine/dist/components/dynamic-body.js +2 -4
- package/dist/mcp/node_modules/@waica/engine/dist/components/sprite.d.ts +19 -0
- package/dist/mcp/node_modules/@waica/engine/dist/components/sprite.js +44 -8
- package/dist/mcp/node_modules/@waica/engine/dist/components/tilemap.d.ts +113 -0
- package/dist/mcp/node_modules/@waica/engine/dist/components/tilemap.js +316 -0
- package/dist/mcp/node_modules/@waica/engine/dist/entity.d.ts +3 -0
- package/dist/mcp/node_modules/@waica/engine/dist/entity.js +13 -1
- package/dist/mcp/node_modules/@waica/engine/dist/game.d.ts +4 -0
- package/dist/mcp/node_modules/@waica/engine/dist/game.js +41 -9
- package/dist/mcp/node_modules/@waica/engine/dist/index.d.ts +9 -0
- package/dist/mcp/node_modules/@waica/engine/dist/index.js +5 -0
- package/dist/mcp/node_modules/@waica/engine/dist/projection.d.ts +14 -0
- package/dist/mcp/node_modules/@waica/engine/dist/projection.js +30 -0
- package/dist/mcp/node_modules/@waica/engine/dist/scene-solids.d.ts +16 -0
- package/dist/mcp/node_modules/@waica/engine/dist/scene-solids.js +28 -0
- package/dist/mcp/node_modules/@waica/engine/dist/scene.d.ts +3 -1
- package/dist/mcp/node_modules/@waica/engine/dist/solid-axis.js +2 -4
- package/dist/mcp/node_modules/@waica/engine/dist/sprite-placement.d.ts +22 -0
- package/dist/mcp/node_modules/@waica/engine/dist/sprite-placement.js +14 -0
- package/dist/mcp/node_modules/@waica/engine/dist/tilemap-grid.d.ts +26 -0
- package/dist/mcp/node_modules/@waica/engine/dist/tilemap-grid.js +41 -0
- package/dist/mcp/node_modules/@waica/engine/package.json +1 -1
- package/dist/mcp/package-resolver.js +4 -0
- package/dist/mcp/project-component-runner.js +1 -0
- package/package.json +1 -1
|
@@ -21,6 +21,18 @@ export declare class AnimatedSprite extends Component implements YSortParticipan
|
|
|
21
21
|
offsetY: {
|
|
22
22
|
label: string;
|
|
23
23
|
};
|
|
24
|
+
anchorX: {
|
|
25
|
+
label: string;
|
|
26
|
+
min: number;
|
|
27
|
+
max: number;
|
|
28
|
+
step: number;
|
|
29
|
+
};
|
|
30
|
+
anchorY: {
|
|
31
|
+
label: string;
|
|
32
|
+
min: number;
|
|
33
|
+
max: number;
|
|
34
|
+
step: number;
|
|
35
|
+
};
|
|
24
36
|
layer: {
|
|
25
37
|
label: string;
|
|
26
38
|
min: number;
|
|
@@ -56,6 +68,12 @@ export declare class AnimatedSprite extends Component implements YSortParticipan
|
|
|
56
68
|
set offsetX(value: number);
|
|
57
69
|
get offsetY(): number;
|
|
58
70
|
set offsetY(value: number);
|
|
71
|
+
private _anchorX;
|
|
72
|
+
private _anchorY;
|
|
73
|
+
get anchorX(): number;
|
|
74
|
+
set anchorX(value: number);
|
|
75
|
+
get anchorY(): number;
|
|
76
|
+
set anchorY(value: number);
|
|
59
77
|
pixelArt: boolean;
|
|
60
78
|
private _layer;
|
|
61
79
|
get layer(): number;
|
|
@@ -83,7 +101,7 @@ export declare class AnimatedSprite extends Component implements YSortParticipan
|
|
|
83
101
|
onUpdate(dt: number): void;
|
|
84
102
|
onDestroy(): void;
|
|
85
103
|
private showFrame;
|
|
86
|
-
/** Repositions/rescales the
|
|
104
|
+
/** Repositions/rescales the displayed frame inside its anchored full-size box. */
|
|
87
105
|
private syncQuad;
|
|
88
106
|
private applyFrame;
|
|
89
107
|
}
|
|
@@ -2,7 +2,9 @@ import * as THREE from 'three';
|
|
|
2
2
|
import { Component } from '../component.js';
|
|
3
3
|
import { ClipPlayer } from '../animation/clip-player.js';
|
|
4
4
|
import { locateFrame, sheetCell } from '../animation/sheet.js';
|
|
5
|
+
import { spritePlacement } from '../sprite-placement.js';
|
|
5
6
|
const loader = new THREE.TextureLoader();
|
|
7
|
+
const clampAnchor = (value) => Math.min(1, Math.max(0, value));
|
|
6
8
|
/**
|
|
7
9
|
* Sprite animated from one or more spritesheets. The main sheet is the
|
|
8
10
|
* top-level texture/cols/rows (or explicit cells); extraSheets append after
|
|
@@ -18,6 +20,8 @@ export class AnimatedSprite extends Component {
|
|
|
18
20
|
static params = {
|
|
19
21
|
offsetX: { label: 'x offset' },
|
|
20
22
|
offsetY: { label: 'y offset' },
|
|
23
|
+
anchorX: { label: 'x anchor', min: 0, max: 1, step: 0.25 },
|
|
24
|
+
anchorY: { label: 'y anchor', min: 0, max: 1, step: 0.25 },
|
|
21
25
|
layer: { label: 'layer', min: -5, max: 5, step: 1 },
|
|
22
26
|
};
|
|
23
27
|
static transient = [
|
|
@@ -82,6 +86,22 @@ export class AnimatedSprite extends Component {
|
|
|
82
86
|
this._offsetY = value;
|
|
83
87
|
this.syncQuad();
|
|
84
88
|
}
|
|
89
|
+
_anchorX = 0.5;
|
|
90
|
+
_anchorY = 0.5;
|
|
91
|
+
get anchorX() {
|
|
92
|
+
return this._anchorX;
|
|
93
|
+
}
|
|
94
|
+
set anchorX(value) {
|
|
95
|
+
this._anchorX = clampAnchor(value);
|
|
96
|
+
this.syncQuad();
|
|
97
|
+
}
|
|
98
|
+
get anchorY() {
|
|
99
|
+
return this._anchorY;
|
|
100
|
+
}
|
|
101
|
+
set anchorY(value) {
|
|
102
|
+
this._anchorY = clampAnchor(value);
|
|
103
|
+
this.syncQuad();
|
|
104
|
+
}
|
|
85
105
|
pixelArt = true;
|
|
86
106
|
// Draw order among sprites: higher layers render in front. Same-layer
|
|
87
107
|
// sprites fall back to spawn order, so give overlap an explicit layer.
|
|
@@ -182,16 +202,24 @@ export class AnimatedSprite extends Component {
|
|
|
182
202
|
this.frame = index;
|
|
183
203
|
this.applyFrame();
|
|
184
204
|
}
|
|
185
|
-
/** Repositions/rescales the
|
|
205
|
+
/** Repositions/rescales the displayed frame inside its anchored full-size box. */
|
|
186
206
|
syncQuad() {
|
|
187
207
|
if (!this.mesh)
|
|
188
208
|
return;
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
209
|
+
const placement = spritePlacement({
|
|
210
|
+
width: this.width,
|
|
211
|
+
height: this.height,
|
|
212
|
+
offsetX: this.offsetX,
|
|
213
|
+
offsetY: this.offsetY,
|
|
214
|
+
anchorX: this.anchorX,
|
|
215
|
+
anchorY: this.anchorY,
|
|
216
|
+
flipX: this.flipX,
|
|
217
|
+
frameScaleX: this.frameScaleX,
|
|
218
|
+
frameScaleY: this.frameScaleY,
|
|
219
|
+
});
|
|
220
|
+
this.mesh.position.x = placement.x;
|
|
221
|
+
this.mesh.position.y = placement.y;
|
|
222
|
+
this.mesh.scale.set(placement.scaleX, placement.scaleY, 1);
|
|
195
223
|
}
|
|
196
224
|
applyFrame() {
|
|
197
225
|
const located = locateFrame(this.sheets, this.frame);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { COLLISION_SHAPES, collisionBounds, collisionOverlap, resolveCollisionPoints, } from '../collision-shape.js';
|
|
2
2
|
import { Component } from '../component.js';
|
|
3
|
+
import { sceneSolids } from '../scene-solids.js';
|
|
3
4
|
import { resolveSolidAxis } from '../solid-axis.js';
|
|
4
5
|
import { Solid } from './solid.js';
|
|
5
6
|
/** Stable tie order for equal-distance initial-overlap recovery. */
|
|
@@ -161,10 +162,7 @@ export class DynamicBody extends Component {
|
|
|
161
162
|
return { entity: solid.entity, solid, axis, normal };
|
|
162
163
|
}
|
|
163
164
|
solids() {
|
|
164
|
-
return this.game.
|
|
165
|
-
.filter((entity) => entity !== this.entity)
|
|
166
|
-
.map((entity) => entity.get(Solid))
|
|
167
|
-
.filter((solid) => solid !== undefined);
|
|
165
|
+
return sceneSolids(this.game, this.entity);
|
|
168
166
|
}
|
|
169
167
|
collisionBody() {
|
|
170
168
|
return {
|
|
@@ -14,6 +14,18 @@ export declare class Sprite extends Component implements YSortParticipant {
|
|
|
14
14
|
offsetY: {
|
|
15
15
|
label: string;
|
|
16
16
|
};
|
|
17
|
+
anchorX: {
|
|
18
|
+
label: string;
|
|
19
|
+
min: number;
|
|
20
|
+
max: number;
|
|
21
|
+
step: number;
|
|
22
|
+
};
|
|
23
|
+
anchorY: {
|
|
24
|
+
label: string;
|
|
25
|
+
min: number;
|
|
26
|
+
max: number;
|
|
27
|
+
step: number;
|
|
28
|
+
};
|
|
17
29
|
layer: {
|
|
18
30
|
label: string;
|
|
19
31
|
min: number;
|
|
@@ -37,6 +49,12 @@ export declare class Sprite extends Component implements YSortParticipant {
|
|
|
37
49
|
set offsetX(value: number);
|
|
38
50
|
get offsetY(): number;
|
|
39
51
|
set offsetY(value: number);
|
|
52
|
+
private _anchorX;
|
|
53
|
+
private _anchorY;
|
|
54
|
+
get anchorX(): number;
|
|
55
|
+
set anchorX(value: number);
|
|
56
|
+
get anchorY(): number;
|
|
57
|
+
set anchorY(value: number);
|
|
40
58
|
/** Optional texture URL; with pixelArt on it filters in nearest. */
|
|
41
59
|
texture?: string;
|
|
42
60
|
pixelArt: boolean;
|
|
@@ -51,5 +69,6 @@ export declare class Sprite extends Component implements YSortParticipant {
|
|
|
51
69
|
private mesh?;
|
|
52
70
|
onReady(): void;
|
|
53
71
|
onDestroy(): void;
|
|
72
|
+
private syncQuad;
|
|
54
73
|
private createGeometry;
|
|
55
74
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
2
|
import { Component } from '../component.js';
|
|
3
|
+
import { spritePlacement } from '../sprite-placement.js';
|
|
3
4
|
const loader = new THREE.TextureLoader();
|
|
5
|
+
const clampAnchor = (value) => Math.min(1, Math.max(0, value));
|
|
4
6
|
/**
|
|
5
7
|
* Textured or flat-color quad. In the unified pipeline, a 2D sprite is a
|
|
6
8
|
* plane in front of the orthographic camera (see DESIGN.md §6, decision 2).
|
|
@@ -10,6 +12,8 @@ export class Sprite extends Component {
|
|
|
10
12
|
static params = {
|
|
11
13
|
offsetX: { label: 'x offset' },
|
|
12
14
|
offsetY: { label: 'y offset' },
|
|
15
|
+
anchorX: { label: 'x anchor', min: 0, max: 1, step: 0.25 },
|
|
16
|
+
anchorY: { label: 'y anchor', min: 0, max: 1, step: 0.25 },
|
|
13
17
|
layer: { label: 'layer', min: -5, max: 5, step: 1 },
|
|
14
18
|
};
|
|
15
19
|
static transient = ['mesh'];
|
|
@@ -22,14 +26,14 @@ export class Sprite extends Component {
|
|
|
22
26
|
}
|
|
23
27
|
set width(value) {
|
|
24
28
|
this._width = value;
|
|
25
|
-
this.
|
|
29
|
+
this.syncQuad();
|
|
26
30
|
}
|
|
27
31
|
get height() {
|
|
28
32
|
return this._height;
|
|
29
33
|
}
|
|
30
34
|
set height(value) {
|
|
31
35
|
this._height = value;
|
|
32
|
-
this.
|
|
36
|
+
this.syncQuad();
|
|
33
37
|
}
|
|
34
38
|
_color = 0xffffff;
|
|
35
39
|
get color() {
|
|
@@ -46,16 +50,30 @@ export class Sprite extends Component {
|
|
|
46
50
|
}
|
|
47
51
|
set offsetX(value) {
|
|
48
52
|
this._offsetX = value;
|
|
49
|
-
|
|
50
|
-
this.mesh.position.x = value;
|
|
53
|
+
this.syncQuad();
|
|
51
54
|
}
|
|
52
55
|
get offsetY() {
|
|
53
56
|
return this._offsetY;
|
|
54
57
|
}
|
|
55
58
|
set offsetY(value) {
|
|
56
59
|
this._offsetY = value;
|
|
57
|
-
|
|
58
|
-
|
|
60
|
+
this.syncQuad();
|
|
61
|
+
}
|
|
62
|
+
_anchorX = 0.5;
|
|
63
|
+
_anchorY = 0.5;
|
|
64
|
+
get anchorX() {
|
|
65
|
+
return this._anchorX;
|
|
66
|
+
}
|
|
67
|
+
set anchorX(value) {
|
|
68
|
+
this._anchorX = clampAnchor(value);
|
|
69
|
+
this.syncQuad();
|
|
70
|
+
}
|
|
71
|
+
get anchorY() {
|
|
72
|
+
return this._anchorY;
|
|
73
|
+
}
|
|
74
|
+
set anchorY(value) {
|
|
75
|
+
this._anchorY = clampAnchor(value);
|
|
76
|
+
this.syncQuad();
|
|
59
77
|
}
|
|
60
78
|
/** Optional texture URL; with pixelArt on it filters in nearest. */
|
|
61
79
|
texture;
|
|
@@ -101,8 +119,8 @@ export class Sprite extends Component {
|
|
|
101
119
|
material.color.set(0xffffff);
|
|
102
120
|
}
|
|
103
121
|
this.mesh = new THREE.Mesh(this.createGeometry(), material);
|
|
104
|
-
this.mesh.
|
|
105
|
-
this.
|
|
122
|
+
this.mesh.position.z = this.layer * 0.01;
|
|
123
|
+
this.syncQuad();
|
|
106
124
|
this.entity.node.add(this.mesh);
|
|
107
125
|
}
|
|
108
126
|
onDestroy() {
|
|
@@ -110,6 +128,24 @@ export class Sprite extends Component {
|
|
|
110
128
|
this.mesh?.geometry.dispose();
|
|
111
129
|
this.mesh?.material.dispose();
|
|
112
130
|
}
|
|
131
|
+
syncQuad() {
|
|
132
|
+
if (!this.mesh)
|
|
133
|
+
return;
|
|
134
|
+
const placement = spritePlacement({
|
|
135
|
+
width: this.width,
|
|
136
|
+
height: this.height,
|
|
137
|
+
offsetX: this.offsetX,
|
|
138
|
+
offsetY: this.offsetY,
|
|
139
|
+
anchorX: this.anchorX,
|
|
140
|
+
anchorY: this.anchorY,
|
|
141
|
+
flipX: false,
|
|
142
|
+
frameScaleX: 1,
|
|
143
|
+
frameScaleY: 1,
|
|
144
|
+
});
|
|
145
|
+
this.mesh.position.x = placement.x;
|
|
146
|
+
this.mesh.position.y = placement.y;
|
|
147
|
+
this.mesh.scale.set(placement.scaleX, placement.scaleY, 1);
|
|
148
|
+
}
|
|
113
149
|
createGeometry() {
|
|
114
150
|
return this._shape === 'circle'
|
|
115
151
|
? new THREE.CircleGeometry(0.5, 32)
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { Component } from '../component.js';
|
|
2
|
+
import { SOLID_SOURCE_SYMBOL, type SolidSource } from '../scene-solids.js';
|
|
3
|
+
import { type TilemapCell, type TilemapCellBounds } from '../tilemap-grid.js';
|
|
4
|
+
import { Solid } from './solid.js';
|
|
5
|
+
/** One authorable cell map rendered as a single merged geometry. */
|
|
6
|
+
export declare class Tilemap extends Component implements SolidSource {
|
|
7
|
+
static componentName: string;
|
|
8
|
+
static params: {
|
|
9
|
+
color: {
|
|
10
|
+
label: string;
|
|
11
|
+
};
|
|
12
|
+
cols: {
|
|
13
|
+
label: string;
|
|
14
|
+
min: number;
|
|
15
|
+
step: number;
|
|
16
|
+
};
|
|
17
|
+
rows: {
|
|
18
|
+
label: string;
|
|
19
|
+
min: number;
|
|
20
|
+
step: number;
|
|
21
|
+
};
|
|
22
|
+
mapWidth: {
|
|
23
|
+
label: string;
|
|
24
|
+
min: number;
|
|
25
|
+
step: number;
|
|
26
|
+
};
|
|
27
|
+
mapHeight: {
|
|
28
|
+
label: string;
|
|
29
|
+
min: number;
|
|
30
|
+
step: number;
|
|
31
|
+
};
|
|
32
|
+
cellSize: {
|
|
33
|
+
label: string;
|
|
34
|
+
min: number;
|
|
35
|
+
step: number;
|
|
36
|
+
};
|
|
37
|
+
layer: {
|
|
38
|
+
label: string;
|
|
39
|
+
min: number;
|
|
40
|
+
max: number;
|
|
41
|
+
step: number;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
static transient: string[];
|
|
45
|
+
readonly [SOLID_SOURCE_SYMBOL] = true;
|
|
46
|
+
private _texture;
|
|
47
|
+
get texture(): string;
|
|
48
|
+
set texture(value: string);
|
|
49
|
+
private _color;
|
|
50
|
+
get color(): number;
|
|
51
|
+
set color(value: number);
|
|
52
|
+
private _cols;
|
|
53
|
+
get cols(): number;
|
|
54
|
+
set cols(value: number);
|
|
55
|
+
private _rows;
|
|
56
|
+
get rows(): number;
|
|
57
|
+
set rows(value: number);
|
|
58
|
+
private _gridOffsetX;
|
|
59
|
+
get gridOffsetX(): number;
|
|
60
|
+
set gridOffsetX(value: number);
|
|
61
|
+
private _gridOffsetY;
|
|
62
|
+
get gridOffsetY(): number;
|
|
63
|
+
set gridOffsetY(value: number);
|
|
64
|
+
private _spacingX;
|
|
65
|
+
get spacingX(): number;
|
|
66
|
+
set spacingX(value: number);
|
|
67
|
+
private _spacingY;
|
|
68
|
+
get spacingY(): number;
|
|
69
|
+
set spacingY(value: number);
|
|
70
|
+
private _cellWidth;
|
|
71
|
+
get cellWidth(): number;
|
|
72
|
+
set cellWidth(value: number);
|
|
73
|
+
private _cellHeight;
|
|
74
|
+
get cellHeight(): number;
|
|
75
|
+
set cellHeight(value: number);
|
|
76
|
+
private _pixelArt;
|
|
77
|
+
get pixelArt(): boolean;
|
|
78
|
+
set pixelArt(value: boolean);
|
|
79
|
+
private _mapWidth;
|
|
80
|
+
get mapWidth(): number;
|
|
81
|
+
set mapWidth(value: number);
|
|
82
|
+
private _mapHeight;
|
|
83
|
+
get mapHeight(): number;
|
|
84
|
+
set mapHeight(value: number);
|
|
85
|
+
private _cellSize;
|
|
86
|
+
get cellSize(): number;
|
|
87
|
+
set cellSize(value: number);
|
|
88
|
+
private _cells;
|
|
89
|
+
get cells(): number[];
|
|
90
|
+
set cells(value: number[]);
|
|
91
|
+
private _solidTiles;
|
|
92
|
+
get solidTiles(): number[];
|
|
93
|
+
set solidTiles(value: number[]);
|
|
94
|
+
private _layer;
|
|
95
|
+
get layer(): number;
|
|
96
|
+
set layer(value: number);
|
|
97
|
+
private mesh?;
|
|
98
|
+
private loadedTexture?;
|
|
99
|
+
private derivedSolids;
|
|
100
|
+
onReady(): void;
|
|
101
|
+
onProjectionChange(): void;
|
|
102
|
+
onDestroy(): void;
|
|
103
|
+
solids(): readonly Solid[];
|
|
104
|
+
cellIndex(column: number, row: number): number | null;
|
|
105
|
+
cellAt(logicalX: number, logicalY: number): TilemapCell | null;
|
|
106
|
+
cellBounds(column: number, row: number): TilemapCellBounds | null;
|
|
107
|
+
private gridSpec;
|
|
108
|
+
private rebuildMap;
|
|
109
|
+
private rebuildMaterial;
|
|
110
|
+
private makeMaterial;
|
|
111
|
+
private rebuildGeometry;
|
|
112
|
+
private rebuildSolids;
|
|
113
|
+
}
|