Overview (MAS Script Effect) |
Print Previous Next |
Introduction
Overview There are several functions called by MADRIX in order to let the script react to different events.
If a function is not needed by a script, it is not necessary to implement it. Regarding InitEffect and RenderEffect a message is printed out if one of them is missing. This is not an error, but only an information for the developer of the script.
InitEffect (Automatically included in a new script) InitEffect is called by MADRIX whenever the script needs to be initialized. This is the case after compiling and starting a new script or when the user pressed the Start button of the »Script Editor. A script can assume that any global variable is initialized with 0 and that any global array is empty as long as it has not been initialized with any value. This function is the right place to initialize global variables, reset any arrays, set the speed of an effect, or whatever is necessary to (re)start the script.
RenderEffect (Automatically included in a new script) This function is called whenever the effect needs to be rendered. This is the right place to calculate the effect and draw it onto the matrix.
MartrixSizeChanged (Automatically included in a new script) MatixSizeChanged is called after the size of the matrix has been changed. This may be due to a change to the matrix settings or because a new map setting was set, e.g. caused by the call of a map function.
Standard Outline A newly created macro for an effect will look like this: @scriptname=""; @author=""; @version=""; @description="";
void InitEffect() {
}
void RenderEffect() {
}
void MatrixSizeChanged() { InitEffect(); }
|
MADRIX Version: 3.6j | Script Version: 2.22 |
[Ctrl & +/-] = Zoom In/Out | [Ctrl & 0] = 100% |
Print Previous Next |