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

ViewHelper: Make label text and style configurable. #28688

Merged
merged 6 commits into from
Jun 21, 2024
Merged

ViewHelper: Make label text and style configurable. #28688

merged 6 commits into from
Jun 21, 2024

Conversation

puxiao
Copy link
Contributor

@puxiao puxiao commented Jun 18, 2024

Added label text to display configuration items.

#28312 (comment)

class ViewHelper extends Object3D {
-  constructor( camera: Camera, domElement: HTMLElement );
+  constructor( camera: Camera, domElement: HTMLElement, options?: ViewHelperOptions );
}
export interface ViewHelperOptions {
    font?: string  //default value: '24px Arial'
    labelColor?: string //default value: '#000000'
    posXLabel?: string //default value: null (no display)
    posYLabel?: string
    posZLabel?: string
    radius?: number //default value: 14
}

If you want bold text :

{
-   font: '24px Arial',
+   font: 'Bold 24px Arial',
    posXLabel: 'X',
    posYLabel: 'Y',
    posZLabel: 'Z',
}

If you want to display in Chinese :

const viewHelper = new ViewHelper( camera, renderer.domElement, {
    posXLabel: '右',
    posYLabel: '上',
    posZLabel: '前',
    font: 'Bold 24px Arial',
    labelColor: '#000000',
    radius: 20,
} )

@Mugen87 Mugen87 added this to the r166 milestone Jun 20, 2024
@Mugen87 Mugen87 changed the title ViewHelper: Add options to the constructor ViewHelper: Make label text and style configurable. Jun 20, 2024
@Mugen87 Mugen87 merged commit 96ba72e into mrdoob:dev Jun 21, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants