This page has been translated automatically.
Видеоуроки
Interface
Essentials
Advanced
Подсказки и советы
Основы
Программирование на C#
Рендеринг
Professional (SIM)
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Физика
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Настройки и предпочтения
Работа с проектами
Настройка параметров ноды
Setting Up Materials
Настройка свойств
Освещение
Sandworm
Использование инструментов редактора для конкретных задач
Расширение функционала редактора
Встроенные объекты
Ноды (Nodes)
Объекты (Objects)
Эффекты
Декали
Источники света
Geodetics
World-ноды
Звуковые объекты
Объекты поиска пути
Players
Программирование
Основы
Настройка среды разработки
Примеры использования
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Плагины
Форматы файлов
Materials and Shaders
Rebuilding the Engine Tools
Интерфейс пользователя (GUI)
Двойная точность координат
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
Работа с контентом
Оптимизация контента
Материалы
Визуальный редактор материалов
Сэмплы материалов
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
Внимание! Эта версия документация УСТАРЕЛА, поскольку относится к более ранней версии SDK! Пожалуйста, переключитесь на самую актуальную документацию для последней версии SDK.
Внимание! Эта версия документации описывает устаревшую версию SDK, которая больше не поддерживается! Пожалуйста, обновитесь до последней версии SDK.

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