console
The source engine console library.
Classes & types
class
console.Command
The console command object.
type
console.CommandOptions
Table used by console.Command class constructor.
type
console.Flag
class
console.Logger
The logger object.
type
console.LoggerOptions
Table used by console.Logger constructor.
class
console.Variable
The console variable object.
type
console.VariableOptions
Table used by console.Variable class constructor.
Fields
| Name | Type | Description |
|---|---|---|
visible | boolean | true if the console is visible, false otherwise. |
show | | Shows the console. |
Events
#console.Visibility
An event that is called with the new visibility when the console is shown or hidden.
Functions
console.clear | Clears the console output. |
console.flag | Returns the integer flag value for the given flag name. |
console.flags | Builds an integer flag value from the given flag map. |
console.hide | Hides the console. |
console.toggle | Toggles the console. |
console.write | Writes a message to the console. |
console.writeLine | Writes a message to the console with new line after the text. |
#console.clear
function console.clear()
Clears the console output.
#console.flag
function console.flag(flag_name: console.Flags): integer
Returns the integer flag value for the given flag name.
Parameters
| Name | Type | Description |
|---|---|---|
flag_name | console.Flags |
Returns
| Type | Name | Description |
|---|---|---|
integer | int32_flag |
#console.flags
function console.flags(int32_flags: integer, flag_map: table<console.Flags, boolean>): integer
Builds an integer flag value from the given flag map.
Parameters
| Name | Type | Description |
|---|---|---|
int32_flags | integer | |
flag_map | table<console.Flags, boolean> |
Returns
| Type | Name | Description |
|---|---|---|
integer | flag |
#console.hide
function console.hide()
Hides the console.
#console.toggle
function console.toggle()
Toggles the console.
#console.write
function console.write(...: string | Color)
Writes a message to the console.
Parameters
| Name | Type | Description |
|---|---|---|
... | string | Color | The message to write to the console. |
#console.writeLine
function console.writeLine(...: string | Color)
Writes a message to the console with new line after the text.
Parameters
| Name | Type | Description |
|---|---|---|
... | string | Color | The message to write to the console. |