Resizes the grid to a new width and height.


GML Code Example

ds_grid_resize(index, w, h);

Argument Description
index This index of the grid to resize.
w The new width of the grid.
h The new height of the grid.

Returns: N/A


With this function you can resize the given ds_grid to have a different width and/or height. If the grid size is larger than the current grid, the new cells will have a base value of 0, and if the size is smaller then the values held in the cells that are no longer within the new size will be lost. All other cells will be left untouched.


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