ds_grid_multiply_region

Multiplies all the values found in the given region by a given amount.

Syntax:

GML Code Example

ds_grid_multiply_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 multiply with the region cells.


Returns: N/A


Description

With this function you can specify a region of the grid in which to multiply each cell value by a given amount.

NOTE: This function will only work with real numbers, not strings.


Example:

GML Code Example

ds_grid_multiply_region( mygrid, 5, 5, 10, 10, 2 );

The above code will take all the values found within the defined rectangular grid area and multiply each one by 2.





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