UNPKG

pencil.js

Version:

Nice modular interactive 2D drawing library.

67 lines (66 loc) 1.52 kB
/** * @module Button */ /** * Button class * <br><img src="./media/examples/button.png" alt="button demo"/> * @class * @extends {module:Input} */ export default class Button { /** * @typedef {Object} ButtonOptions * @extends TextOptions * @extends InputOptions * @prop {String} [value=""] - Text of the button */ /** * @type {ButtonOptions} */ static get defaultOptions(): any; /** * Margin around the text * @type {Number} */ static get MARGIN(): number; /** * Button constructor * @param {PositionDefinition} positionDefinition - Position of the top-left corner * @param {ButtonOptions} [options] - Specific options */ constructor(positionDefinition: PositionDefinition, options?: any); text: Text; /** * Computer button size * @return {{width: Number, height: Number}} */ get size(): { width: number; height: number; }; /** * Get this button's width * @return {Number} */ get width(): number; /** * Get this button's height * @return {Number} */ get height(): number; /** * @inheritDoc */ click(): void; /** * Change this button's text * @param {String|Array<String>} value - Any text or list of line */ set value(value: string | string[]); /** * Return this button's text * @return {String} */ get value(): string; } import Text from "@pencil.js/text";