|
<< Click To Display Table Of Contents >> You Are Here: MADRIX Script (Introduction) > Basics > Data Types And Variables |
▪In MADRIX Script variables may be used to store different data.
▪ Each variable will be defined with a certain data type.
▪This data type describes the kind of values the variable can store and the operations which are possible with the variable.
Here is a small example to get a feeling for variables. The following source code renders a yellow pixel on a random position each time RenderEffect is called.
@scriptname="SetRandomPixel";
@author="inoage";
@version="";
@description="";
void InitEffect()
{
}
void RenderEffect()
{
color col = {255, 255, 0, 0};
int px,py;
px = random(0,GetMatrixWidth()-1);
py = random(0,GetMatrixHeight()-1);
SetPixel(col, px, py);
//a color variable called 'col' is declared and its values are set to yellow (RGB)
//two variables of type int are declared to store the coordinates of a pixel
//coordinates for x and y inside the matrix are chosen by chance
//the pixel is drawn on the matrix
}
void MatrixSizeChanged()
{
InitEffect();
}
| MADRIX 3.23. |
| [Ctrl & +/-] = Zoom In/Out | [Ctrl & 0] = 100% |
|
Previous Next
|
|
Enable Automatic Translation | Activer La Traduction Automatique | 启用自动翻译 |