ds_grid_get_max

This function can be used to find the maximum value for all the cells found within the defined region of a grid, as shown in the image below:

DS grid get max

Syntax:

ds_grid_get_max(index, x1, y1, x2, y2);

ArgumentType Description
indexDS Grid The index of the grid.
x1Real The left cell column of the region.
y1Real The top cell row of the region.
x2Real The right cell column of the region.
y2Real The bottom cell row of the region.

 

Returns:

Real or String

 

Example:

val = ds_grid_get_max(grid, 0, 0, 5, 5)

The above code will set the variable "val" to the maximum value contained within the given region of the DS grid indexed in the variable "grid".