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

WidgetIcon Class

This class creates a toggleable icon with two states - pressed or not.

WidgetIcon Class

This class inherits from Widget

Members


WidgetIcon (Gui gui, string texture = 0, int width = 0, int height = 0)

Constructor. Creates an icon of the specified size using a given texture.

Arguments

  • Gui gui - GUI, to which the new icon will belong.
  • string texture - The path to a texture file.
  • int width - The width.
  • int height - The height.

Image getImage ()

Returns the icon image.

Return value

Icon image.

int getTextAlign ()

Returns the current alignment flag set for the floating text over the icon.

Return value

Alignment flag (one of the GUI_ALIGN_* variables).

string getText ()

Returns the current floating text set to be over the icon.

Return value

Floating text.

string getTexture ()

Returns path to the icon image.

Return value

Path to the icon image.

int isToggleable ()

Returns a value indicating if the icon is a toggle button or a simple button.

Return value

Positive number if the icon is a toggle button; otherwise, 0.

int isToggled ()

Returns a value indicating if the icon serving as a toggle button is pressed.

Return value

1 if the button is pressed; otherwise, 0.

void setImage (Image image)

Sets an icon image.

Arguments

  • Image image - Image to set.

void setTextAlign (int align)

Sets the alignment flag for the floating text over the icon. The default is GUI_ALIGN_CENTER.

Arguments

  • int align - Alignment flag (see GUI_ALIGN_* variables).

void setText (string str)

Sets the floating text over the icon.

Arguments

  • string str - Floating text.

void setTexture (string texture)

Sets a texture to be used as the icon image.

Arguments

  • string texture - Path to a texture file.

void setToggleable (int mode)

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

Arguments

  • int mode - Positive number to make the icon a toggle button, 0 to make it a simple button.

void setToggled (int state)

Sets a state of the icon as a toggle button.

Arguments

  • int state - Positive number to press the button, 0 to release it.
Last update: 2017-07-03