Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/tooltip improvements #120

Merged
merged 4 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
8 changes: 4 additions & 4 deletions packages/3d-web-client-core/src/character/CharacterTooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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: "",
Expand Down Expand Up @@ -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) {
Expand Down
Loading