You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added several new compile defines to change the behavior of Polymod
POLYMOD_ROOT_PATH: Defines the base path from which scripts should be accessed.
POLYMOD_USE_NAMESPACE: If true, scripts are located in a folder based on the classpath.
For example, the script com.polymod.test#init will be located at /data/com/polymod/test/init.txt.
POLYMOD_SCRIPT_EXT: Defines the file extension used by all Polymod scripts.
This defaults to .txt for backwards compatibility, but should be changed to .hscript to improve integration with IDEs.
POLYMOD_SCRIPT_LIBRARY: Defines the asset library used by all Polymod scripts.
This defaults to default, which should be fine for Lime projects which only utilize the default asset library.
Set these values using either of the following methods:
For Haxe projects, add something like -D POLYMOD_SCRIPT_EXT=.hscript to your Haxe compiler arguments or hxml.
For Lime projects, add something like <haxedef name="POLYMOD_SCRIPT_EXT" value=".hscript" /> to your project.xml.
Added the new variable script_variables, accessible after the execution of a scripted function.
Similar to script_result, which provides the return value of the script, and script_error, which outputs the error provided by the script, script_variables provides access to the named variables created by the script's local scope.
One use case for this is to allow a single script to define several named functions, which can be retrieved and stored to use later.