Skip to content

class_buttonarray

reduz edited this page Feb 23, 2014 · 9 revisions

ButtonArray

####Inherits: Control ####Category: Core

Brief Description

Array of Buttons.

Member Functions

Signals

  • button&#95selected ( int button )

Numeric Constants

  • ALIGN_BEGIN = 0 - Align buttons at the begining.
  • ALIGN_CENTER = 1 - Align buttons in the middle.
  • ALIGN_END = 2 - Align buttons at the end.
  • ALIGN_FILL = 3 - Spread the buttons, but keep them small.
  • ALIGN_EXPAND_FILL = 4 - Spread the buttons, but expand them.

Description

Array of Buttons. A Button array is useful to have an array of buttons laid out vertically or horizontally. Only one can be selected. This is useful for joypad based interfaces and option menus.

Member Function Description

  • void add&#95button ( String text )

Add a new button.

  • void set&#95button&#95icon ( int button, Object icon )

Set the icon of an existing button.

  • String get&#95button&#95text ( int button ) const

Return the text of an existing button.

  • Object get&#95button&#95icon ( int button ) const

Return the icon of an existing button.

  • int get&#95button&#95count ( ) const

Return the amount of buttons in the array.

  • int get&#95selected ( ) const

Return the currently selected button in the array.

  • int get&#95hovered ( ) const

Return the currently hovered button in the array.

  • void set&#95selected ( int button )

Sekect a button in the array.

  • void erase&#95button ( int button )

Remove a button in the array, by index.

  • void clear ( )

Clear the button array.

Clone this wiki locally