Skip to content

Commit

Permalink
feat(event-display): add size and color options for labels
Browse files Browse the repository at this point in the history
  • Loading branch information
9inpachi committed Feb 9, 2021
1 parent d8c6485 commit 3ce675f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/phoenix-event-display/src/three/scene-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ export class SceneManager {

const textGeometry = new TextGeometry(label, {
font: this.textFont,
size: 20,
size: 60,
curveSegments: 1,
height: 1
});
Expand Down
23 changes: 23 additions & 0 deletions packages/phoenix-event-display/src/ui/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,29 @@ export class UIManager {
if (this.hasPhoenixMenu && this.labelsFolderPM === null) {
this.labelsFolderPM = this.phoenixMenu.addChild(SceneManager.LABELS_ID, () => { }, 'info');

this.labelsFolderPM.addConfig('slider', {
label: 'Size',
min: 0, max: 10, step: 0.01,
allowCustomValue: true,
onChange: (scale: number) => {
const labels = this.three.getSceneManager().getObjectsGroup(SceneManager.LABELS_ID);
labels.children.forEach((singleLabel) => {
this.three.getSceneManager().scaleObject(singleLabel.name, scale);
});
}
});

this.labelsFolderPM.addConfig('color', {
label: 'Color',
color: '#a8a8a8',
onChange: (value: any) => {
const labels = this.three.getSceneManager().getObjectsGroup(SceneManager.LABELS_ID);
labels.children.forEach((singleLabel) => {
this.three.getSceneManager().changeObjectColor(singleLabel.name, value);
});
}
});

this.labelsFolderPM.addConfig('button', {
label: 'Save Labels',
onClick: () => {
Expand Down

0 comments on commit 3ce675f

Please sign in to comment.