FUNCTION |
PARAMETERS |
RETURN |
INFO |
GLOBAL VARIABLES MANAGEMENT |
|||
setGlobal(string unique_name, string value) |
string unique_name : Global
variable unique name |
|
|
string value getGlobal(string unique_name) |
string unique_name : Global variable unique name |
string value : Current value of the global variable |
|
deleteGlobal(string unique_name) |
string unique_name : Global variable unique name |
|
|
AMBIENT EFFECTS |
|||
int r, int g, int b getAmbientLight() |
|
int r : Red
value (0, 1, ..., 255) |
Usage sample: |
int r, int g, int b getFogColor() |
|
int r : Red
value (0, 1, ..., 255) |
Usage sample: |
float near, float far getFogRange() |
|
float near
: Current near fog value |
Usage sample: |
setAmbientLight(table color_name) |
table color_name : check "colors.lua" at "media/scripts/" folder. |
|
Usage sample: |
setAmbientLight(int r, int g, int b) |
int r : Red
value (0, 1, ..., 255) |
|
Usage
sample: |
setFogColor(table color_name) |
table color_name : check "colors.lua" at "media/scripts/" folder. |
|
Usage sample: |
setFogRange(float near, float far) |
float near
: Fog nearest distance |
|
Usage sample: |
setFogColor(int r, int g, int b) |
int r
: Red value (0, 1, ..., 255) |
|
Usage sample: |
setTimeOfDay(int time) |
int time : Day time (0, 1, ..., 24) |
|
Usage sample: |
MENU AND SCREEN MANAGEMENT |
|||
hideBlackScreen() |
|
|
Usage sample: |
showBlackScreen(string optional_text) |
string optional_text : Optional text, it is drawed at the center of the black screen |
|
Usage
sample: |
DYNAMIC OBJECTS AND CAMERA |
|||
float x, float y, float z getCameraTarget() |
|
float x
: Camera target position X |
Usage sample: |
float x, float y, float z getObjectPosition(dynamic_object object_name) |
dynamic_object object_name : global name of a dynamic object |
float x
: Object position X |
Usage sample: |
float x, float y, float z getPosition() |
|
float x
: Current object position X |
Usage sample: |
setCameraTarget(dynamic_object object_name) |
|
dynamic_object object_name : global name of a dynamic object |
Usage sample: |
setCameraTarget(float x, float y, float z) |
float x
: Camera target position X |
|
Usage sample: |
setPosition(float x, float y, float z) |
float x
: Current object position X |
|
Usage sample: |
SOUND FUNCTIONS |
|||
playSound2D(string sound_filename, bool looped) |
string
sound_filename :
Sound file of "media/sound/" folder |
|
Usage
sample: |
playSound3D(string sound_filename, bool looped, float x, float y, float z) |
string
sound_filename :
Sound file from "media/sound/" folder |
|
Usage
sample: |
setSoundListenerPosition(float x, float y, float z) |
float x
: 3D sound listener position X |
|
Usage
sample: |
setSoundVolume(float volume) |
float volume : Global sound volume - volume 0 (silent) to 1.0 (full volume) |
|
Usage sample: |
stopSounds() |
|
|
Usage sample: |
PLAYER FUNCTIONS |
|||
addPlayerItem(string item_name) |
string item_name : Name of the item to be added to player bag |
|
Usage
sample: |
int total_items getItemCount() |
|
int total_items : Total of items in player bag |
Usage sample: |
float life getPlayerLife() |
|
float life : Current player Life |
Usage sample: |
removePlayerItem(string item_name) |
string item_name : Name of the item to be removed from player bag |
|
Usage
sample: |
setPlayerLife(float life) |
float life : New player life value |
|
Usage sample: |
DIALOG FUNCTIONS |
|||
showDialogMessage(string text, string sound_filename) |
string text : Message
text |
|
Usage sample: |
bool answer showDialogQuestion(string text, string sound_filename) |
string text : Message
text |
bool answer : True/False according to user choice |
Usage sample: |