This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
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
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
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.WidgetEditText Class

Inherits from: 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

Properties

string Text#

The contents of the text field.

int NumLines#

The number of lines in the text field.

int SelectionLine#

The number of the line where selection starts.

int SelectionPosition#

The cursor position in the line where selection starts.

int CursorLine#

The number of the current line.

int CursorPosition#

The cursor position in the current line.

vec4 NumberColor#

The color which is used for numbers.

vec4 SelectionColor#

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

vec4 BackgroundColor#

The background color for the widget.

int Background#

The value indicating if a background texture is rendered for the text field. The default is 1.

bool Editable#

The value indicating if the contents of the text field can be edited. The default is 1.

Members


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.

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

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 contained in the line.

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.

string GetSelectionText ( ) #

Returns the currently selected text.

Return value

Currently selected text.

void SetTokenColor ( string token, vec4 color ) #

Sets a color for 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

Color of the current token.

void SetTokensColor ( string tokens, vec4 color ) #

Sets a color to given tokens. Each token will be highlighted with the provided 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.
Last update: 2022-12-14
Build: ()