import { vec2, vec3 } from 'gl-matrix'; import { Camera } from '../camera'; import { GLfloat2, GLfloat3 } from '../tuples'; import { FontFace } from './fontface'; import { GlyphVertices } from './glyphvertices'; import { Label } from './label'; import { Text } from './text'; /** * A Label that can be positioned in 3D space, but projected onto a 2D plane (a.k.a. screen). * The unit for positioning is world space, the unit for size is pixel (px). */ export declare class Projected3DLabel extends Label { private static readonly DEFAULT_FONTSIZE_PX; /** @see {@link position} */ protected _position: vec3; /** @see {@link direction} */ protected _direction: vec2; /** @see {@link camera} */ protected _camera: Camera | undefined; /** * Constructs a pre-configured projected 3D-label with given text. Depending on the label type, transformations are * applied once when typesetting (static) or every frame during rendering (dynamic). * @param text - The text that is displayed by this label. * @param type - Either static or dynamic. If static is used, all transformations are baked and modifications to * on any of the label's transformations are expected to occur less often. * @param fontFace - The font face that should be used for that label, or undefined if set later. */ constructor(text: Text, type: Label.Type, fontFace?: FontFace); /** * If altered, creates a position and direction-vector, then prepares the vertex storage and invokes * typesetting. Depending on the label's type (static or dynamic) the transform is stored and applied either during * typesetting (static) or passed as single transform to the vertex shader during rendering (dynamic). */ typeset(force?: boolean): GlyphVertices | undefined; /** * The camera is used to retrieve (1) the view projection matrix, and (2) the width and height of targeted frame. * (1) is used to project the 3D label as a 2D label, (2) is used to calculate the font size in px units. * Setting the camera invalidates the transform. */ set camera(camera: Camera | undefined); get camera(): Camera | undefined; /** * Sets the 3D position of the label's reference point. */ set position(position: vec3 | GLfloat3); get position(): vec3 | GLfloat3; /** * Sets the 2D direction of the label, i.e., the direction of the baseline. */ set direction(direction: vec2 | GLfloat2); get direction(): vec2 | GLfloat2; /** * This unit is used for the font size. This method overrides the super.fontSizeUnit, since `Projected3DLabel` only * supports Pixel, for now. * (@see {@link fontSize}) * @param newUnit - Unit to be used, though, this label type only supports pixel units (px). */ set fontSizeUnit(unit: Label.Unit); get fontSizeUnit(): Label.Unit; }