fixed bug with woka picture snapshot taking current frame and not front

This commit is contained in:
Hanusiak Piotr 2021-12-01 10:45:01 +01:00
parent ecb334cbd2
commit ed8d6855b1
2 changed files with 2 additions and 1 deletions

View file

@ -120,6 +120,7 @@ export abstract class Character extends Container {
public async getSnapshot(): Promise<HTMLImageElement> {
const rt = this.scene.make.renderTexture({}, false);
for (const sprite of this.sprites.values()) {
sprite.setFrame(1);
rt.draw(sprite, sprite.displayWidth * 0.5, sprite.displayHeight * 0.5);
}
return new Promise<HTMLImageElement>((resolve, reject) => {