From 08384f40c2aabf09ea7aab400c560088e1f13580 Mon Sep 17 00:00:00 2001 From: TheCodeTherapy Date: Tue, 19 Mar 2024 11:06:35 +0000 Subject: [PATCH 1/2] reposition the CharacterTooltip to make it more discreet and improve environment visibility --- .../3d-web-client-core/src/character/CharacterTooltip.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/3d-web-client-core/src/character/CharacterTooltip.ts b/packages/3d-web-client-core/src/character/CharacterTooltip.ts index 6a2918bf..16819485 100644 --- a/packages/3d-web-client-core/src/character/CharacterTooltip.ts +++ b/packages/3d-web-client-core/src/character/CharacterTooltip.ts @@ -21,10 +21,10 @@ const fontScale = 5; const defaultLabelColor = new Color(0x000000); const defaultFontColor = new Color(0xffffff); const defaultLabelAlignment = LabelAlignment.center; -const defaultLabelFontSize = 9; +const defaultLabelFontSize = 8; const defaultLabelPadding = 0; const defaultLabelWidth = 0.25; -const defaultLabelHeight = 0.125; +const defaultLabelHeight = 0.1; const defaultLabelCastShadows = true; const tooltipGeometry = new PlaneGeometry(1, 1, 1, 1); @@ -34,7 +34,7 @@ export class CharacterTooltip extends Mesh { private visibleOpacity: number = 0.85; private targetOpacity: number = 0; private fadingSpeed: number = 0.02; - private secondsToFadeOut: number = 15; + private secondsToFadeOut: number = 10; private props = { content: "", @@ -98,7 +98,7 @@ export class CharacterTooltip extends Mesh { this.scale.x = width / (100 * fontScale); this.scale.y = height / (100 * fontScale); - this.position.y = 1.6; + this.position.y = 1.4; } setText(text: string, temporary: boolean = false) { From bfc98f2b69f88d6c7ec7754468f9dcdc80e6a8b4 Mon Sep 17 00:00:00 2001 From: TheCodeTherapy Date: Tue, 19 Mar 2024 11:07:02 +0000 Subject: [PATCH 2/2] fades out local character's tooltip after 10 seconds, while keeping remote players' --- packages/3d-web-client-core/src/character/CharacterManager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/3d-web-client-core/src/character/CharacterManager.ts b/packages/3d-web-client-core/src/character/CharacterManager.ts index cc4dcbc4..9c40dca7 100644 --- a/packages/3d-web-client-core/src/character/CharacterManager.ts +++ b/packages/3d-web-client-core/src/character/CharacterManager.ts @@ -89,7 +89,7 @@ export class CharacterManager { ); this.localCharacter.position.set(spawnPosition.x, spawnPosition.y, spawnPosition.z); this.localCharacter.rotation.set(spawnRotation.x, spawnRotation.y, spawnRotation.z); - character.tooltip?.setText(`${id}`); + character.tooltip?.setText(`${id}`, true); this.group.add(character); this.localCharacterSpawned = true; }