Changing TileSprite.width or TileSprite.height will now flag the texture as dirty and call updateDisplayOrigin, allowing you to resize TileSprites dynamically in both Canvas and WebGL.

This commit is contained in:
Richard Davey 2018-11-20 15:32:15 +00:00
parent 1e32537276
commit f1fdc5dcf5
2 changed files with 4 additions and 0 deletions

View file

@ -94,6 +94,7 @@
* `Tile.getCollisionGroup` wouldn't return the correct Group after the change to support multiple Tilesets. It now returns the group properly (thanks @jbpuryear)
* `Tile.getTileData` wouldn't return the correct data after the change to support multiple Tilesets. It now returns the tile data properly (thanks @jbpuryear)
* The `GetTileAt` and `RemoveTileAt` components would error with "Cannot read property 'index' of undefined" if the tile was undefined rather than null. It now handles both cases (thanks @WaSa42)
* Changing `TileSprite.width` or `TileSprite.height` will now flag the texture as dirty and call `updateDisplayOrigin`, allowing you to resize TileSprites dynamically in both Canvas and WebGL.
### Examples and TypeScript

View file

@ -470,6 +470,9 @@ var TileSprite = new Class({
canvas.height = this.height;
this.frame.setSize(this.width, this.height);
this.updateDisplayOrigin();
this.dirty = true;
}
if (!this.dirty || this.renderer && this.renderer.gl)