ds_grid_multiply_grid_region

Multiplies the contents of the cells in a source grid with the cells in a destination grid.

Syntax:

GML Code Example

ds_grid_multiply_grid_region(index, source, x1, y1, x2, y2, xpos, ypos);


Argument Description
index The index of the destination grid.
source The index of the source grid.
x1 The left position of the region of cells to copy from the source grid.
y1 The top position of the region of cells to copy from the source grid.
x2 The right position of the region of cells to copy from the source grid.
y2 The bottom position of the region of cells to copy from the source grid.
xpos The x position on the destination grid to multiply the source region with.
ypos The y position on the destination grid to multiply the source region with.


Returns: N/A


Description

With this function you can define an area within a given ds_grid, then take those values and multiply them with those found in a separate region of either the same ds_grid, or another one (which has been previously created). The original region will remain unchanged, while the region that they have been multiplied with will now store the new values for each cell.


Example:

GML Code Example

ds_grid_multiply_grid_region(mygrid, mygrid, 0, 0, 5, 5, 0, 0);

This would take the region of cells from (0,0) to (5,5) of the ds_grid "mygrid" and multiply them with the cells from position (0,0) of the same ds_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