Getting Started
Migrating to UNIGINE 2.0
C++ API Migration
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
Usage Examples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins

Unigine::WidgetButton Class

Interface for widget button handling. See also UnigineScript analog.

To use this class, include the UnigineWidgetButton.h file.

Unigine::WidgetButton Class

Members


static int type ()

WidgetButton type.

Return value

WidgetButton type identifier.

static Ptr< WidgetButton > create (const WidgetPtr & widget)

WidgetButton constructor.

Arguments

  • const WidgetPtr & widget - Widget smart pointer.

static Ptr< WidgetButton > create ()

WidgetButton constructor.

virtual void setBackground (int background) const =0

Sets a value indicating if a background texture should be rendered for the button. By default, the background texture is always rendered. The default is 1.

Arguments

  • int background - 1 to render the background texture, 0 not to render. The default is 1.

virtual int getBackground () const =0

Returns a value indicating if a background texture is rendered for the button. The default is 1.

Return value

1 if a background texture is rendered; otherwise, 0.

virtual void setToggleable (int toggleable) const =0

Sets a value indicating if the button is a toggle button or a simple one.

Arguments

  • int toggleable - 1 to make the button a toggle button, 0 to make it a simple one. The default is 0.

virtual int isToggleable () const =0

Returns a value indicating if the button is a toggle button or a simple one. The default is 0.

Return value

1 if the button is a toggle button; otherwise, 0.

virtual void setToggled (int toggled) const =0

Sets a state of the toggle button.

Arguments

  • int toggled - 1 to press the button, 0 to release it.

virtual int isToggled () const =0

Returns a value indicating if the toggle button is pressed.

Return value

1 if the button is pressed; otherwise, 0.

virtual void setImage (const ImagePtr & image) const =0

Updates a button image.

Arguments

  • const ImagePtr & image - Image to set.

virtual void getImage () const =0

Returns the button image.

Return value

image Button image.

virtual void setTexture (const char * name) const =0

Sets a button image texture.

Arguments

  • const char * name - Path to a texture file.

virtual const char * getTexture () const =0

Returns the path to the button image texture.

Return value

Path to the button image texture.

virtual void setTextAlign (int align) const =0

Sets alignment of the button label.

Arguments

virtual int getTextAlign () const =0

Returns alignment of the button label.

Return value

Alignment of the button label: one of the Unigine::Gui:: Enumeration with ALIGN_* prefixes.

virtual void setText (const char * str) const =0

Sets a button text label.

Arguments

  • const char * str - Button label.

virtual const char * getText () const =0

Returns the button text label.

Return value

Button label.
Last update: 2017-07-03