UNPKG

pencil.js

Version:

Nice modular interactive 2D drawing library.

45 lines (44 loc) 1.07 kB
/** * @module Button */ /** * Button class * <br><img src="./media/examples/button.png" alt="button demo"/> * @class * @extends Input */ export default class Button extends Input { /** * 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: any, options?: ButtonOptions); 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; } export type ButtonOptions = any; import Input from "@pencil.js/input"; import Text from "@pencil.js/text";