ds_grid_get_disk_sum

This function can be used to add all the values all the cells found within the defined disk area of a grid together, as shown in the image below:

DS grid get disk sum

 

Syntax:

ds_grid_get_disk_sum(index, xm, ym, r);

ArgumentTypeDescription
indexDS GridThe index of the grid.
xmRealThe x position of the disk on the grid.
ymRealThe y position of the disk on the grid.
rRealThe radius of the disk on the grid.

 

Returns:

Real or String

 

Example:

val = ds_grid_get_disk_sum(grid, 5, 5, 2)

The above code will set the variable "val" to the sum of all values contained within the given disk of the DS grid indexed in the variable "grid".