MCPcopy Create free account
hub / github.com/melonjs/melonJS / setTile

Method setTile

packages/melonjs/src/level/tiled/TMXObject.js:212–221  ·  view source on GitHub ↗

* set the object image (for Tiled Object) * @ignore

(tilesets)

Source from the content-addressed store, hash-verified

210 * @ignore
211 */
212 setTile(tilesets) {
213 const tileset = tilesets.getTilesetByGid(this.gid);
214
215 if (tileset.isCollection === false) {
216 this.width = this.framewidth = tileset.tilewidth;
217 this.height = this.frameheight = tileset.tileheight;
218 }
219
220 this.tile = new Tile(this.x, this.y, this.gid, tileset);
221 }
222
223 /**
224 * parses the TMX shape definition and returns a corresponding array of shape objects

Callers 1

constructorMethod · 0.95

Calls 1

getTilesetByGidMethod · 0.80

Tested by

no test coverage detected