SetRenderScript
From Spheriki
Calls a script after all map layers have been drawn. This is usually used to draw things over the screen.
Contents |
Usage
- script String, holding the script to be executed.
Examples
SetRenderScript("draw_heads_up_display();");
// ...
MapEngine("my_map.rmp", 60);
The idea behind SetRenderScript is that you set it before you run the map engine. Also, get used to the idea of seeing code inside a string. The string can use single or double quotes to denote the ends.
Notes
- The script given to this function is only triggered when the map is drawn, after the layers have been rendered, which may differ from when the map state updates. For non-drawing continuous logic, consider using SetUpdateScript() instead.
- The
scriptparameter is a string holding JavaScript code, which means it is runtime-evaluated. As such, any errors in it will not appear until the script encounters it. The rest of your code can be checked while editing (using F7 to Check Syntax in the Sphere editor), or before running (automatic).
- To delimit the parameter, you can use either single quotes or double quotes. It's usually easier to use whichever one doesn't appear in the string itself.