mirror of
https://github.com/photonstorm/phaser
synced 2024-11-22 20:53:39 +00:00
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:
parent
1e32537276
commit
f1fdc5dcf5
2 changed files with 4 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue