CopperLicht API Documentation
Class CL3D.CopperCubeVariable
Interface class for accessing CopperCube variables
Class Overview
CL3D.CopperCubeVariable()
Interface class for accessing CopperCube variables, which can be set and changed using the Actions and
Behaviors in the CopperCube editor. Use the static function CL3D.CopperCubeVariable.getVariable to get an
instance of a variable.
Method Attributes | Method Name and Description |
---|---|
getName()
Returns the name of the variable
|
|
Returns the value of the variable as float
|
|
Returns the value of the variable as int
|
|
Returns the value of the variable as string
|
|
<static> |
CL3D.CopperCubeVariable.getVariable(n, createIfNotExisting, scene)
Static function, returns the instance of an existing CopperCube variable or creates one if not existing.
|
isFloat()
Returns if this variable is a float value
|
|
isInt()
Returns if this variable is an int value
|
|
isString()
Returns if this variable is a string
|
|
setName(n)
Sets the name of the variable
|
|
Sets the value of the variable as float
|
|
Sets the value of the variable as int
|
|
Sets the value of the variable as string
|
Method Detail
getName()
Returns the name of the variable
getValueAsFloat()
Returns the value of the variable as float
getValueAsInt()
Returns the value of the variable as int
getValueAsString()
Returns the value of the variable as string
<static>
{CL3D.CopperCubeVariable}
CL3D.CopperCubeVariable.getVariable(n, createIfNotExisting, scene)
Static function, returns the instance of an existing CopperCube variable or creates one if not existing.
- Parameters:
- n
- {String} Name of the variable
- createIfNotExisting
- {Boolean} if the variable is not found, it will be created if this is set to true.
- scene
- {CL3D.Scene} The current scene. This parameter is optional, this can be 0. It is used for getting runtime variables such as #player1.health
- Returns:
- {CL3D.CopperCubeVariable} Returns instance of the variable or null if not found
isFloat()
Returns if this variable is a float value
isInt()
Returns if this variable is an int value
isString()
Returns if this variable is a string
setName(n)
Sets the name of the variable
- Parameters:
- n
- Name
setValueAsFloat(v)
Sets the value of the variable as float
- Parameters:
- v
- the new value
setValueAsInt(v)
Sets the value of the variable as int
- Parameters:
- v
- the new value
setValueAsString(v)
Sets the value of the variable as string
- Parameters:
- v
- the new value