This page has been translated automatically.
Programming
Fundamentials
Setting Up Development Environment
UnigineScript
High-Level Systems
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Bounds-Related Classes
Containers
Controls-Related Classes
Core Library
GUI-Related Classes
Node-Related Classes
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
Rendering-Related Classes
Utility Classes
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Console Class

Unigine console.

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

Console Class

Members


void setWarningColor (const Math::vec4 & color)

Sets a color for warning messages in the console.

Arguments

  • const Math::vec4 & color - Four-component vector specifying the color in the RGBA format.

int isCommand (const char * name)

Returns a value indicating if a command with a given name exists.

Arguments

  • const char * name - Name of the command.

Return value

Returns 1 if the command with a given name exists; otherwise, 0.

void setErrorColor (const Math::vec4 & color)

Sets a color for error messages in the console.

Arguments

  • const Math::vec4 & color - Four-component vector specifying the color in the RGBA format.

int removeCommand (const char * name)

Removes a custom console command.

Arguments

  • const char * name - Name of the custom console command.

Return value

Returns 1 if the custom command is removed successfully; otherwise, 0.

void setInt (const char * name, int value)

Sets an integer value for a given variable.

Arguments

  • const char * name - Name of the variable.
  • int value - Integer value of the variable.

void run (const char * command)

Runs a console command.

Arguments

  • const char * command - Console command with arguments, a string.

int addCommand (const char * name, const char * desc, CallbackBase * callback)

Adds a custom console command bound to a given script function.

Arguments

  • const char * name - Name of the command.
  • const char * desc - Command description.
  • CallbackBase * callback - Callback pointer. The callback arguments must be (int,char**,...).

Return value

Returns 1 if the custom command is added successfully; otherwise, 0.

void setTextColor (const Math::vec4 & color)

Sets a common font color for the console.

Arguments

  • const Math::vec4 & color - Four-component vector specifying the color in the RGBA format.

const char * getString (const char * name)

Returns the string value of a given variable.

Arguments

  • const char * name - Name of the variable.

Return value

String value of the variable.

void setMessageColor (const Math::vec4 & color)

Sets a color for ordinary messages in the console.

Arguments

  • const Math::vec4 & color - Four-component vector specifying the color in the RGBA format.

int getInt (const char * name)

Returns an integer value of a given variable.

Arguments

  • const char * name - Name of the variable.

Return value

Integer value of the variable.

int getLock ()

Checks if the console is disabled.

Return value

1 if the console is disabled; otherwise, 0.

int isVariable (const char * name)

Returns a value indicating if a variable with a given name exists.

Arguments

  • const char * name - Name of the variable.

Return value

Returns 1 if the variable exists; otherwise, 0.

void setBackgroundColor (const Math::vec4 & color)

Sets a background color for the console.

Arguments

  • const Math::vec4 & color - Four-component vector specifying the color in the RGBA format.

float getFloat (const char * name)

Returns a float value of a given variable.

Arguments

  • const char * name - Name of the variable.

Return value

Float value of the variable.

void setFloat (const char * name, float value)

Sets a float value for a given variable.

Arguments

  • const char * name - Name of the variable.
  • float value - Float value of the variable.

void setActivity (int activity)

Opens or closes the console. By default the console is closed.

Arguments

  • int activity - 1 to make the console active (opened); otherwise, 0.

void setString (const char * name, const char * value)

Sets a string value for a given variable.

Arguments

  • const char * name - Name of the variable.
  • const char * value - String value of the variable.

int getActivity ()

Returns a value indicating if the console is opened or closed.

Return value

Returns 1 if the console is active (opened); otherwise, 0.

void setLock (int lock)

Disables or enables the console. By default the console is enabled.

Arguments

  • int lock - Positive integer to disable the console; otherwise, 0.

void setPrompt (const char * str)

Updates the console prompt. The default prompt is Unigine~#.

Arguments

  • const char * str - New console prompt.

void flush ()

Forces to execute all queued console commands.
Last update: 2017-07-03
Build: ()