/** * This class represents text on the canvas * @author Eirik Måseidvåg */ import { CanvasElementName } from '..'; import { TextOptions } from './types'; import CanvasElement from '../abstract/CanvasElement'; export default class Text extends CanvasElement { /** * The text to write */ text: string; /** * The text color. Represented as a hexadecimal number * E.g. 0xffffff (white) * @public */ color: number; /** * The color of the background. Represented as a hexadecimal number * Transparent if undefined * E.g. 0xffffff (white) * @public */ backgroundColor: number | undefined; /** * The size of the text * @public */ size: number; /** * The center point to put the text * @public */ point: { x: number; y: number; }; /** * Returns the type of this canvas element * @returns CanvasElementName.TEXT */ name: CanvasElementName; /** * Construct the object * @param options: TextOptions */ constructor(options: TextOptions); }