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: 03.07.2017
Помогите сделать статью лучше
Была ли эта статья полезной?
(или выберите слово/фразу и нажмите Ctrl+Enter