This page has been translated automatically.
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
Usage Examples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Migration
Migrating to UNIGINE 2.0
C++ API Migration
Migrating from UNIGINE 2.0 to UNIGINE 2.1
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine::Console Class

Unigine console.

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

Unigine::Console Class

Members


virtual ~Console ()

Virtual destructor.

static Console * get ()

Returns a pointer to the existing console.

Return value

Pointer to the existing console.

virtual void setActivity (int activity) const =0

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

Arguments

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

virtual int getActivity () const =0

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

Return value

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

virtual void run (const char * command) const =0

Runs a console command.

Arguments

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

virtual void flush () const =0

Forces to execute all queued console commands.

virtual int isVariable (const char * name) const =0

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.

virtual void setInt (const char * name, int value) const =0

Sets an integer value for a given variable.

Arguments

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

virtual int getInt (const char * name) const =0

Returns an integer value of a given variable.

Arguments

  • const char * name - Name of the variable.

Return value

Integer value of the variable.

virtual void setFloat (const char * name, float value) const =0

Sets a float value for a given variable.

Arguments

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

virtual float getFloat (const char * name) const =0

Returns a float value of a given variable.

Arguments

  • const char * name - Name of the variable.

Return value

Float value of the variable.

virtual void setString (const char * name, const char * value) const =0

Sets a string value for a given variable.

Arguments

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

virtual const char * getString (const char * name) const =0

Returns the string value of a given variable.

Arguments

  • const char * name - Name of the variable.

Return value

String value of the variable.

virtual int isCommand (const char * name) const =0

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.

virtual int addCommand (const char * name, const char * desc, CallbackBase * command) const =0

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 * command - Callback pointer. The callback arguments must be (int,char**,...).

Return value

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

virtual int removeCommand (const char * name) const =0

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.
Last update: 2017-07-03
Build: ()