ScreenButton

ScreenButton

A button that can display images on itself, meaning that it works like a Screen and a Button at the same time.

The resolution of the screen inside the button is 16x16.

Properties

ButtonState boolean read only

Returns true if the button is currently pressed, false otherwise.

ButtonDown boolean read only

A boolean flag which will be true only in the time tick the corresponding button changes its state to pressed.

ButtonUp boolean read only

A boolean flag which will be true only in the time tick the corresponding button changes its state to released.

InputSource InputSource

An InputSource to be used to trigger the button state.

VideoChip VideoChip

The VideoChip the screen part of this button is bound to.

Offset vec2 read only

The offset of the screen's top-left position in the corresponding VideoChip's overall rendering buffer.

Width number read only

The width of the screen in pixels.

Height number read only

The height of the screen in pixels.

Events

ScreenButtonEvent : { ButtonDown boolean, ButtonUp boolean, Type string }

Triggered when the ScreenButton is pressed or released.
* ButtonDown is true if the button was just pressed.
* ButtonUp is true is the button was just released.
* Type is "ScreenButtonEvent".