[ Back to Geeks3D.com ]
 GeeXLab
Laboratory for Real Time 3D Programming (prototyping and demos) OpenGL, Lua, Python, GLSL, PhysX and more...Reference Guide XML Nodes
» Back to homepage
» Back to Developer's Guide Index
<script> XML Node
<script
name=""
filename=""
active="TRUE"
run_mode="FRAME"
active="TRUE"
>
<raw_data
>
</raw_data>
</script>
<script>
Allows to load and execute scripts (Lua or Python) especially written to interact with scene's objects.
script element has 5 attributes and 1 sub-element(s)
- name [STRING]: name of this XML node.
- filename [STRING]: location of the script file relative to the main XML script. Conventions: Lua script files extension: *.lua and Python script files extension: *.py
- active [BOOLEAN]: enables (TRUE) or disables (FALSE) the script execution. - Default value = TRUE
- run_mode [ENUM]: specifies the working mode of the script - Default value = FRAME - Values = INIT: the script is executed once at the scene initialization. FRAME: the script is executed every frame. ASYNCHRONOUS: the script is executed manually (hotkey for example).
SIZE: the script is executed when the window's size changes. POST_DIRECT_RENDERING: the script is executed after normal scene rendering and before swap buffer.
- active [BOOLEAN]: enables (TRUE) or disables (FALSE) the script execution. - Default value = TRUE
<raw_data>
Allows to integrate the source code of a script directly in the XML code without requiring an external file.
raw_data element has 0 attributes and 0 sub-element(s)
:
<script name="initScene" run_mode="INIT" filename="init.py" />
<script name="updateScene" run_mode="FRAME" filename="update.py" >
<raw_data><![CDATA[
elapsed = HYP_Utils.GetElapsedTime() * 0.001
]]></raw_data>
</script>
|