Button Node

From RoboPad Wiki
Jump to navigation Jump to search

← Return to Node Catalogue

Button Node
Inputs
    none
Outputs
  • signal
Version Introduced
2.1

The Button Node is a UI Node that places a button on the controller. A button is a simple element that triggers a signal emission when either on press, release or both (default).

Button Nodes were introduced in firmware version 2.1 along with all basic nodes.

Outputs

Button Nodes have a single output - signal, which attempts to emit a 1 (high) value when the button is 'activated', and a 0 (low) when the button is 'deactivated' again. Whether these values are emitted as soon as pressed and released, only on press, only on release, or are toggled with each press is configurable with the Node's Button Mode setting.

Settings

The Button Node's settings can be configured to alter it's visual presentation and mode of operation.

As a UI Node, the Button Node possesses the UI Transform and Background Colour settings. All UI Nodes draw to a region on the controller - this is an area that will be populated by the Button Node's display elements.

  • UI Transform: Configures the position of this Button Node's UI element within the controller. The Position x and y values control the position of the center of this element on the controller, from the bottom left (i.e. x and y values of 0 result in its center being in the bottom left, x and y values of 1 result in its center being in the top right). The Scale x and y values control the width and height of this Button Node's UI element, relative to the controller's width and height. Scaling occurs from the center of the Button.
  • Background Colour: Configures the background colour of this Button Node's UI region when it is drawn to the controller.
  • Activated Colour: Configures the colour the button changes when 'activated'.
  • Button Mode: Configures the behaviour of the button (see below).

Button Modes

The Button Mode setting has three values:

  • sensitive: The button emits a 1 (high) as soon as it's pressed (activated), and also emits a 0 (low) signal as soon as it's released (deactivated).
  • impulse low: The button emits a 0 (low) signal whenever it transitions into a deactivated state (is released), but does not emit a 1 (high) signal when it transitions into an activated state (is pressed).
  • impulse high: The button emits a 1 (high) signal whenever it transitions into an activated state (is pressed), but does not emit a 0 (low) signal when it transitions into a deactivated state (is released).
  • toggle: This mode is identical to sensitive, emitting a signal whenever the button transitions either way (is pressed or released), but in this mode the button toggles meaning that on the first press and release, the button activates, and it will not deactivate until it is pressed again, after which it can be activated again.