ds_grid_create


Description

With this function you can create a new ds_grid data structure of the specified cell width and height. This function returns an id which must be used in all further functions that deal with this ds_grid.

IMPORTANT! When you create a data structure, the index value to identify it is an integer value starting at 0. This means that data structures of different types can have the same index value, so if in doubt you should be using the ds_exists function before accessing them. Also note that indices are re-used, so a destroyed data structure index value may be used by a newly created one afterwards.


Syntax:

ds_grid_create(w, h);

Argument Description
w The width of the grid to be created.
h The height of the grid to be created.


Returns:

Real


Example:

mygrid = ds_grid_create(10, 10)

This creates a grid 10 cells high and 10 cells wide.