This function can be used to clear a given DS grid to a specific value. All cells within the grid will then contain this value, which can be a real number or a string. The image below illustrates how this works:
ds_grid_clear(index, val);
Argument | Type | Description |
---|---|---|
index | DS Grid | This index of the grid to clear. |
val | Any | The new value for all grid cells. |
N/A
ds_grid_resize(global.Grid, room_width / 32, room_height / 32);
ds_grid_clear(global.Grid, -1)
The above code will resize the DS grid indexed in the global variable "Grid" and then clear it so that each cell holds the value -1.