lazy-widgets
Version:
Typescript retained mode GUI for the HTML canvas API
36 lines • 817 B
JavaScript
import { BaseLabel } from './BaseLabel.js';
/**
* A widget which displays a line of text.
*
* Can be updated, but this is done manually via the {@link Label#text}
* accessor.
*
* @category Widget
*/
export class Label extends BaseLabel {
/**
* @param text - The text of the label. Has the same behaviour as setting {@link Label#text}.
*/
constructor(text = '', properties) {
super(properties);
this.text = text;
}
/** The current text value. */
set text(text) {
this.textHelper.text = text;
}
get text() {
return this.textHelper.text;
}
}
Label.autoXML = {
name: 'label',
inputConfig: [
{
mode: 'text',
name: 'text',
optional: true
}
]
};
//# sourceMappingURL=Label.js.map