2019-08-20 17:59:26 +02:00
|
|
|
import Sprite from "./Sprite.js";
|
2020-01-17 21:11:15 +01:00
|
|
|
/**
|
|
|
|
* TileSprite class
|
|
|
|
*/
|
2019-08-20 17:59:26 +02:00
|
|
|
class TileSprite extends Sprite {
|
2020-01-17 21:11:15 +01:00
|
|
|
/**
|
|
|
|
* Creates sprite instance from unindexed spritesheet
|
|
|
|
* @param {*} texture Instance of Texture with source image
|
|
|
|
* @param {number} w Width of sprite on source image
|
|
|
|
* @param {number} h Height of spirte on source image
|
|
|
|
*/
|
|
|
|
constructor(texture, w, h) {
|
2019-08-20 17:59:26 +02:00
|
|
|
super(texture);
|
|
|
|
this.tileW = w;
|
|
|
|
this.tileH = h;
|
|
|
|
this.frame = { x: 0, y: 0 };
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default TileSprite;
|