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

WidgetEditText Class

Warning
The scope of applications for UnigineScript is limited to implementing materials-related logic (material expressions, scriptable materials, brush materials). Do not use UnigineScript as a language for application logic, please consider C#/C++ instead, as these APIs are the preferred ones. Availability of new Engine features in UnigineScipt (beyond its scope of applications) is not guaranteed, as the current level of support assumes only fixing critical issues.
Inherits: Widget

This class creates a simple editable multi-line text area containing text strings.

Notice
Word wrapping and rich text options are not supported for this class.

See Also#

  • UnigineScript API sample <UnigineSDK>/data/samples/widgets/text_00

WidgetEditText Class

Members


static WidgetEditText ( Gui gui, string str = 0 ) #

Constructor. Creates a multiline text field and adds it to the specified GUI.

Arguments

  • Gui gui - GUI, to which the text field will belong.
  • string str - Initial value. This is an optional parameter.

static WidgetEditText ( string str = 0 ) #

Constructor. Creates a multiline text field and adds it to the Engine GUI.

Arguments

  • string str - Initial value. This is an optional parameter.

void setBackground ( int background ) #

Sets a value indicating if a background texture should be rendered for the text field.

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 text field.

Return value

Positive number if a background texture is rendered; otherwise, 0.

void setCursor ( int position, int line ) #

Sets the cursor to a given position in a given line.

Arguments

  • int position - Position number.
  • int line - Line number.

int getCursorLine ( ) #

Returns a number of the current line.

Return value

Line number.

int getCursorPosition ( ) #

Returns a cursor position in the current line.

Return value

Position number.

void setEditable ( int editable ) #

Sets a value indicating if the contents of the text field can be edited.

Arguments

  • int editable - Positive number to make the text field editable, 0 to make it read-only.

int isEditable ( ) #

Returns a value indicating if the contents of the text field can be edited.

Return value

Positive number if the text field contents can be edited; otherwise, 0.

void setLineText ( int line, string str ) #

Sets new contents for a given line.

Arguments

  • int line - Line number.
  • string str - Text.

String getLineText ( int line ) #

Returns the text contained in a given line.

Arguments

  • int line - Line number.

Return value

Text.

int getNumLines ( ) #

Returns the number of lines in the text field.

Return value

Number of lines.

void setSelection ( int position, int line ) #

Sets a line and a position, from which a new selection will start.

Arguments

  • int position - Position number.
  • int line - Line number.

int getSelectionLine ( ) #

Returns a number of the line where selection starts.

Return value

Line number.

int getSelectionPosition ( ) #

Returns a cursor position in the line where selection starts.

Return value

Position number.

String getSelectionText ( ) #

Returns the currently selected text.

Return value

Currently selected text.

void setText ( string text ) #

Sets a text for the text field.

Arguments

  • string text - Text.

string getText ( ) #

Returns the current contents of the text field.

Return value

Text.

void setTokenColor ( string token, vec4 color ) #

Sets a color to a given token. The token will be highlighted with the provided color.

Arguments

  • string token - Token (i.e. keyword, identifier, etc).
  • vec4 color - Color.

vec4 getTokenColor ( string token ) #

Returns a color, which is used to highlight a given token.

Arguments

  • string token - Token.

Return value

Current token color.

void setTokensColor ( string tokens, vec4 color ) #

Sets a color to given tokens. All tokens from the list will be highlighted with the color.

Arguments

  • string tokens - Comma-separated list of tokens (i.e. keywords, identifiers, etc).
  • vec4 color - Color.

int addLine ( string str = 0 ) #

Adds a new line to the widget.

Arguments

  • string str - Text to add. This is an optional argument.

Return value

Number of the added line.

void clearSelectionText ( ) #

Deletes the currently selected text.

void removeLine ( int line ) #

Deletes a given line.

Arguments

  • int line - Line number.

void setBackgroundColor ( vec4 color ) #

Sets the background color for the widget.

Arguments

  • vec4 color - Four-component vector specifying the color in the RGBA format.

vec4 getBackgroundColor ( ) #

Returns the current background color for the widget.

Return value

Four-component vector specifying the color in the RGBA format.

void setSelectionColor ( vec4 color ) #

Sets the color to be used to highlight the current selection for the widget.

Arguments

  • vec4 color - Four-component vector specifying the color in the RGBA format.

vec4 getSelectionColor ( ) #

Returns the current color used to highlight the current selection for the widget.

Return value

Four-component vector specifying the color in the RGBA format.
Last update: 2020-07-31
Build: ()