This page has been translated automatically.
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
Migration
Migrating to UNIGINE 2.0
C++ API Migration
Migrating from UNIGINE 2.0 to UNIGINE 2.1
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Unigine::WidgetIcon Class

Interface for widget icon handling. See also UnigineScript analog.

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

Unigine::WidgetIcon Class

Members


static int type ()

WidgetIcon type.

Return value

WidgetIcon type identifier.

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

WidgetIcon constructor.

Arguments

  • const WidgetPtr & widget - Widget smart pointer.

static Ptr< WidgetIcon > create (const Ptr< Gui > & gui, const char * str)

WidgetIcon constructor.

Arguments

  • const Ptr< Gui > & gui - Gui pointer.
  • const char * str - Path to the icon image file.

virtual void setToggleable (int toggleable) const =0

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

Arguments

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

virtual int isToggleable () const =0

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

Return value

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

virtual void setToggled (int toggled) const =0

Sets a state of the icon as a toggle button.

Arguments

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

virtual int isToggled () const =0

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

Return value

Returns 1 if the button is pressed; otherwise, 0.

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

Sets an icon image.

Arguments

  • const ImagePtr & image - Image to set.

virtual void getImage () const =0

Returns the icon image.

Return value

Icon image.

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

Sets a texture to be used as the icon image.

Arguments

  • const char * Path - to a texture file.

virtual const char * getTexture () const =0

Returns path to the icon image.

Return value

Path to a texture file.

virtual void setTextAlign (int align) const =0

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

Arguments

virtual int getTextAlign () const =0

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

Return value

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

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

Sets the floating text over the icon.

Arguments

  • const char * str - Floating text.

virtual const char * getText () const =0

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

Return value

Floating text.
Last update: 2017-07-03
Build: ()