Elius94 / console-gui-tools

A simple library to draw option menu or other popup inputs and layout on Node.js console.
MIT License
123 stars 18 forks source link

Elius94/issue57 #58

Closed Elius94 closed 1 year ago

Elius94 commented 1 year ago

new Button(id, text, width, height, x, y, style, key, onClick, onRelease, visible, enabled)

This class is an overload of Control that is used to create a button.

Button

Emits the following events:

Param Type Description
id string

The id of the button.

text string

The text of the button.

width number

The width of the button.

height number

The height of the button.

x number

The x position of the button.

y number

The y position of the button.

style ButtonStyle

To set the style of the button.

key ButtonKey | undefined

To set a key to press to click the button.

onClick function

The function to call when the button is clicked.

onRelease function

The function to call when the button is released.

visible boolean

If the button is visible. Default is true (make it hide using hide()).

enabled boolean

If the button is enabled. Default is true (make it disabled using disable()).