Changed the way WOKA's are stored
This commit is contained in:
parent
2ea54fd243
commit
642d3bb301
6 changed files with 61 additions and 73 deletions
31
front/src/Components/Woka/Woka.svelte
Normal file
31
front/src/Components/Woka/Woka.svelte
Normal file
|
@ -0,0 +1,31 @@
|
|||
<script lang="typescript">
|
||||
import { onDestroy } from 'svelte';
|
||||
|
||||
import { gameManager } from '../../Phaser/Game/GameManager';
|
||||
import logoWA from "../images/logo-WA-pixel.png"; // placeholder
|
||||
|
||||
export let userId: number;
|
||||
|
||||
const gameScene = gameManager.getCurrentGameScene();
|
||||
const playerWokaPictureStore = gameScene.getUserWokaPictureStore(userId);
|
||||
|
||||
let src = logoWA;
|
||||
const unsubscribe = playerWokaPictureStore.picture.subscribe((htmlElement) => {
|
||||
src = htmlElement?.src ?? logoWA;
|
||||
});
|
||||
|
||||
onDestroy(unsubscribe);
|
||||
</script>
|
||||
|
||||
<img src={src} alt="woka" class="nes-pointer">
|
||||
|
||||
<style>
|
||||
img {
|
||||
display: block;
|
||||
pointer-events: auto;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
margin: 3px;
|
||||
image-rendering: pixelated;
|
||||
}
|
||||
</style>
|
Loading…
Add table
Add a link
Reference in a new issue