ds_grid_add_region

Adds the given value to all cells in a region.

Syntax:

GML Code Example

ds_grid_add_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 add to the region cells.


Returns: N/A


Description

This function can be used to add a given value (real or string) to all the values of the cells found within the defined area of a grid. The value to be added must be of the same type as that held within the grid cells, ie: you cannot add a string to a real or vice-versa, and for strings this corresponds to concatenation.


Example:

GML Code Example

ds_grid_add_region(grid, 2, 4, 5, 5, ".");

This would add "." to all the strings held in the cells within the defined region of the ds_grid referenced by the variable "grid".





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