Matrix Functions
MatrixSet("matrix object[column,row]","image index (0...3)")
Set and image for the Image matrix item.
For example we would like to display on position 2,3 (Column 2, Row 3) image
number 2.
The matrix object has label MyMatrix:
MatrixSet("MyMatrix[2,3]","2")
We can use 0 in the matrix to tell MMB to set the value for all rows or all
columns, or even for all items:
MatrixSet("MyMatrix[0,3]","2")
set the image 2 for all columns in the row 3
MatrixSet("MyMatrix[5,0]","2")
set the image 2 for all rows in the column 5
MatrixSet("MyMatrix[0,0]","2")
set the image 2 for all columns and rows (all items)
MatrixGet("matrix object[column,row]","variable")
This command will put to the variable the index of the image at the position
[column,row]
Look at this program:
cur = 0
MatrixGet("MyMatrix[2,3]","cur")
if (cur = 1) then
MatrixSet("MyMatrix[2,3]","2")
end
Current Column and Row
If you click on the Matrix object it would be nice to know on which Column and
Row you actually clicked.
The variables MXCOL and MXROW receives this information.
Consider these two lines inside the script in the Image Matrix Object MyMatrix:
MatrixSet("MyMatrix[0,0]","1")
MatrixSet("MyMatrix[MXCOL,MXROW]","2")
These two lines does all the dificult job inside the Image Matrix object
script.
The first line sets all items to image #1 and the second line set the item you
clicked on to image #2.
The variables MXCOL and MXROW are the real beauty behind the Image Matrix.