use png instead of svg for talk icon

This commit is contained in:
Hanusiak Piotr
2022-02-14 10:37:13 +01:00
parent e85f94998f
commit 639c456540
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ export class TalkIcon extends Phaser.GameObjects.Image {
super(scene, x, y, "iconTalk");
this.defaultPosition = { x, y };
this.defaultScale = 0.15;
this.defaultScale = 0.3;
this.shown = false;
this.setAlpha(0);
+4 -3
View File
@@ -251,7 +251,7 @@ export class GameScene extends DirtyScene {
loadCustomTexture(this.load, texture).catch((e) => console.error(e));
}
}
this.load.svg("iconTalk", "/resources/icons/icon_talking.svg");
this.load.image("iconTalk", "/resources/icons/icon_talking.png");
if (touchScreenManager.supportTouchScreen) {
this.load.image(joystickBaseKey, joystickBaseImg);
@@ -646,6 +646,7 @@ export class GameScene extends DirtyScene {
this.connect();
}
const talkIconVolumeTreshold = 10;
let oldPeerNumber = 0;
this.peerStoreUnsubscribe = peerStore.subscribe((peers) => {
this.volumeStoreUnsubscribers.forEach((unsubscribe) => unsubscribe());
@@ -656,7 +657,7 @@ export class GameScene extends DirtyScene {
key,
videoStream.volumeStore.subscribe((volume) => {
if (volume) {
this.MapPlayersByKey.get(key)?.showTalkIcon(volume > 5);
this.MapPlayersByKey.get(key)?.showTalkIcon(volume > talkIconVolumeTreshold);
}
})
);
@@ -671,7 +672,7 @@ export class GameScene extends DirtyScene {
if (newPeerNumber > 0) {
this.localVolumeStoreUnsubscriber = localVolumeStore.subscribe((volume) => {
if (volume) {
this.CurrentPlayer.showTalkIcon(volume > 5);
this.CurrentPlayer.showTalkIcon(volume > talkIconVolumeTreshold);
}
});
} else {