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> { public async getSnapshot(): Promise<HTMLImageElement> {
const rt = this.scene.make.renderTexture({}, false); const rt = this.scene.make.renderTexture({}, false);
for (const sprite of this.sprites.values()) { for (const sprite of this.sprites.values()) {
sprite.setFrame(1);
rt.draw(sprite, sprite.displayWidth * 0.5, sprite.displayHeight * 0.5); rt.draw(sprite, sprite.displayWidth * 0.5, sprite.displayHeight * 0.5);
} }
return new Promise<HTMLImageElement>((resolve, reject) => { return new Promise<HTMLImageElement>((resolve, reject) => {

View File

@ -201,7 +201,7 @@ export class GameScene extends DirtyScene {
private objectsByType = new Map<string, ITiledMapObject[]>(); private objectsByType = new Map<string, ITiledMapObject[]>();
private embeddedWebsiteManager!: EmbeddedWebsiteManager; private embeddedWebsiteManager!: EmbeddedWebsiteManager;
private loader: Loader; private loader: Loader;
private userWokaPictureStores: Map<number, UserWokaPictureStore> = new Map<number, any>(); private userWokaPictureStores: Map<number, UserWokaPictureStore> = new Map<number, UserWokaPictureStore>();
constructor(private room: Room, MapUrlFile: string, customKey?: string | undefined) { constructor(private room: Room, MapUrlFile: string, customKey?: string | undefined) {
super({ super({