import { vec2 } from 'gl-matrix'; import { GLfloat2 } 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 2D space. The unit for positions, size and transformations, is pixel (px). */ export declare class Position2DLabel extends Label { private static readonly DEFAULT_FONTSIZE_PX; /** @see {@link position} */ protected _position: vec2; /** @see {@link direction} */ protected _direction: vec2; /** @see {@link frameSize} */ protected _frameSize: vec2; /** * Constructs a pre-configured 2D-label with given text * @param text - The text that is displayed by this label. * @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; /** * Width and height of targeted frame used to account for font size in px or pt units. Changing the frame size * invalidates the transform. */ set frameSize(size: vec2 | GLfloat2); get frameSize(): vec2 | GLfloat2; /** * Sets the 2D position of the label's reference point. */ set position(position: vec2 | GLfloat2); get position(): vec2 | GLfloat2; /** * 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 `Position2DLabel` 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; }