speech bubbles

This commit is contained in:
Evert Prants 2022-04-09 18:17:07 +03:00
parent b79460e8ac
commit a353c0347d
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
2 changed files with 4 additions and 3 deletions

View File

@ -138,7 +138,7 @@ export class Game {
);
if (player && player.user.id !== this.me.id) {
// (player as PlayerEntity).addChat(event.message);
(player as PlayerEntity).addChat(event.message);
}
this.chat.addMessage(event.sender.display_name, event.message);

View File

@ -64,11 +64,12 @@ export class PlayerEntity extends PonyEntity {
const newChat = new ChatBubble(chatBuilder, lines);
this._chats.forEach((item) => {
item.tag.position.add(new THREE.Vector3(0, item.height * 0.01, 0));
const scaled = item.tag.scale.y;
item.tag.position.add(new THREE.Vector3(0, scaled, 0));
});
this._chats.unshift(newChat);
newChat.tag.position.set(0, 1.8, 0.5);
newChat.tag.position.set(0, 1.8 + this.nameTag.tag.scale.y + 0.15, 0.5);
this.container.add(newChat.tag);
if (this._chats.length > 3) {