ds_grid_set_region

Sets the all cells in the region in the grid with the given id, to the indicated value (can both be a number or a string).

Syntax:

GML Code Example

ds_grid_set_region(index, x1, y1, x2, y2, val);


Argument Description
index The index of the grid.
x1 The x position of the left of the region in the grid.
y1 The y position of the top of the region in the grid.
x2 The x position of the right of the region in the grid.
y2 The y position of the bottom of the region in the grid.
val The value to set the region cells to.


Returns: N/A


Description

This function can be used to set a rectangular region of a given grid to a specified value (which can be either a real or a string) as illustrated by the image shown below:


Example:

GML Code Example

ds_grid_set_region(grid, 5, 5, 10, 10, 99);
 

This would set all cells within the region of the grid indexed in the variable "grid" from (5,5) to (10,10) to 99.





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