This page has been translated automatically.
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
Plugins Library
High-Level Systems
Samples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Content Creation
Materials
Unigine Material Library
Tutorials
Внимание! Эта версия документация УСТАРЕЛА, поскольку относится к более ранней версии SDK! Пожалуйста, переключитесь на самую актуальную документацию для последней версии SDK.
Внимание! Эта версия документации описывает устаревшую версию SDK, которая больше не поддерживается! Пожалуйста, обновитесь до последней версии SDK.

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)

Constructor. Creates an empty icon.

Arguments

  • Gui gui - GUI, to which the new icon will belong.

WidgetIcon (Gui gui, string texture)

Constructor. Creates an icon using a given texture.

Arguments

  • Gui gui - GUI, to which the new icon will belong.
  • string texture - Path to a texture file.

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: 03.07.2017
Build: ()