This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
FAQ
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
CIGI Client Plugin
Rendering-Related Classes
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.WidgetButton Class

Inherits:Widget

Interface for widget button handling.

WidgetButton Class

Members


static WidgetButton(Gui gui, string str = 0)

Constructor. Creates a button with a given label.

Arguments

  • Gui gui - GUI, to which the new button will belong.
  • string str - Button label. This is an optional parameter.

WidgetButton cast(Widget widget)

Casts a WidgetButton out of the Widget instance.

Arguments

  • Widget widget - Widget instance.

Return value

WidgetButton instance.

void setBackground(int background)

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 - Positive number to render a background texture, 0 not to render.

int getBackground()

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.

void setImage(Image image)

Updates a button image.

Arguments

  • Image image - Image to set.

void getImage(Image image)

Returns the button image.

Arguments

  • Image image

void setText(string text)

Sets a button text label.

Arguments

  • string text - Button label.

string getText()

Returns the button text label.

Return value

Button label.

void setTextAlign(int align)

Sets alignment of the button label.

Arguments

  • int align - One of the GUI_ALIGN_* pre-defined variables.

int getTextAlign()

Returns alignment of the button label.

Return value

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

void setTexture(string texture)

Sets a button image texture.

Arguments

  • string texture - Path to a texture file.

string getTexture()

Returns the path to the button image texture.

Return value

Path to the button image texture.

void setToggleable(int toggleable)

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

Arguments

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

int isToggleable()

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.

void setToggled(int toggled)

Sets a state of the toggle button.

Arguments

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

int isToggled()

Returns a value indicating if the toggle button is pressed.

Return value

1 if the button is pressed; otherwise, 0.

int type()

WidgetButton type.

Return value

WidgetButton type identifier.
Last update: 2018-08-10
Build: ()