Clears the grid with the given id to an indicated value.


GML Code Example

ds_grid_clear(index, val);

Argument Description
index This index of the grid to clear.
val The new value for all grid cells.

Returns: N/A


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:


GML Code Example

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.

Back: DS Grids

No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here