ds_grid_multiply_region

With this function you can specify a region of the grid in which to multiply each cell value by a given amount.

NOTE This function will only work with real numbers, not strings.

 

Syntax:

ds_grid_multiply_region(index, x1, y1, x2, y2, val);

ArgumentTypeDescription
indexDS GridThe index of the grid.
x1RealThe x position of the left of the region in the grid.
y1RealThe y position of the top of the region in the grid.
x2RealThe x position of the right of the region in the grid.
y2RealThe y position of the bottom of the region in the grid.
valRealThe value to multiply with the region cells.

 

Returns:

N/A

 

Example:

ds_grid_multiply_region(mygrid, 5, 5, 10, 10, 2);

The above code will take all the values found within the defined rectangular grid area and multiply each one by 2.