UNPKG

duckengine

Version:
46 lines (45 loc) 1.26 kB
import { Duck } from '../../../index'; import Game from '../../game'; import Scene from '../../scene'; import UI from './ui'; /** * @class Text * @classdesc Creates a DuckEngine Text * @description The Button Class. Renders Text to the canvas * @extends UI * @since 1.0.0-beta */ export default class Text extends UI<'color'> { /** * @memberof Text * @description Text string * @type string * @since 1.0.0-beta */ text: string; protected config: Duck.Types.UI.Text.Config; /** * @constructor Text * @description Creates a Text instance. * @param {string} text Text string * @param {Duck.Types.UI.Text.Config} config Text configuration, styles, position and more * @param {Game} game Game instance * @param {Scene} scene Scene instance * @since 1.0.0-beta */ constructor(text: string, config: Duck.Types.UI.Text.Config, game: Game, scene: Scene); /** * @description Draws the text. * * DO NOT CALL MANUALLY, CALLED IN GAME LOOP USING SCENE.displayList * */ _draw(): void; /** * @memberof Text * @description Sets the text string * @param {string} text * @since 1.0.0-beta */ setText(text: string): void; }