Files
tower/js/simple_tile_factory.js

19 lines
769 B
JavaScript
Raw Permalink Normal View History

2021-05-11 02:57:17 +00:00
import { SimpleTile } from './simple_tile.js';
2021-05-11 05:28:20 +00:00
import { AnimatableTileFactory } from './animatable_tile_factory.js';
export class SimpleTileFactory extends AnimatableTileFactory {
constructor(layer_name, width, height, name) {
super(layer_name, width, height);
2021-05-11 02:57:17 +00:00
this.name = name;
}
build(tileset) {
2021-05-17 04:26:18 +00:00
return new SimpleTile(...this.animatable_tile_args(), `images/${this.name.replace('{tileset}', tileset)}`);
2021-05-11 02:57:17 +00:00
}
2021-05-11 05:17:16 +00:00
copy() {
const stf = new SimpleTileFactory(this.layer_name, this.width, this.height, this.name);
for (const [name, [keyframes, options]] of this.animations) {
stf.add_animation(name, keyframes, options);
}
return stf;
}
2021-05-11 02:57:17 +00:00
}
//# sourceMappingURL=simple_tile_factory.js.map