ds_grid_copy

Copies one grid into another grid.

Syntax:

GML Code Example

ds_grid_copy(destination, source);


Argument Description
destination This index of the grid to copy to.
source This index of the grid to copy from.


Returns: N/A


Description

With this function you can copy the contents of one grid into another one. Both grids must have been created previously using the ds_grid_create function.


Example:

GML Code Example

n_grid = ds_grid_create(ds_grid_width(a_grid), ds_grid_height(a_grid));
 ds_grid_copy(n_grid, a_grid);
 ds_grid_clear(a_grid, -1);
 

The above code creates a new ds_grid, based on the width and height of a previously created grid, then copies the information form the previous grid to the new one. Finally it clears the old grid so that all cells have a value of -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