MCPcopy Index your code
hub / github.com/esengine/esengine / exportToData

Method exportToData

packages/tilemap/src/TilemapComponent.ts:1173–1188  ·  view source on GitHub ↗

* Export tilemap to data format * 导出瓦片地图为数据格式 * @returns Tilemap data object | 瓦片地图数据对象

()

Source from the content-addressed store, hash-verified

1171 * @returns Tilemap data object | 瓦片地图数据对象
1172 */
1173 exportToData(): ITilemapData {
1174 return {
1175 name: 'Tilemap',
1176 version: 2,
1177 width: this._width,
1178 height: this._height,
1179 tileWidth: this.tileWidth,
1180 tileHeight: this.tileHeight,
1181 tilesets: this._tilesets.map((ts) => ({ ...ts })),
1182 layers: this._layers.map((layer) => ({
1183 ...layer,
1184 data: [...layer.data]
1185 })),
1186 collisionData: this._collisionData.length > 0 ? Array.from(this._collisionData) : undefined
1187 };
1188 }
1189
1190 // ===== IResourceComponent 实现 =====
1191

Callers 1

TilemapEditorPanelFunction · 0.80

Calls 2

mapMethod · 0.45
fromMethod · 0.45

Tested by

no test coverage detected