ds_grid_value_disk_exists

Finds whether a value exists within a circular region off a grid.

Syntax:

GML Code Example

ds_grid_value_disk_exists(index, xm, ym, r, val);


Argument Description
index The index of the grid.
xm The x position of the disk on the grid.
ym The y position of the disk on the grid.
r The radius of the disk on the grid.
val The value to find.


Returns: Boolean


Description

With this function you can check to see if a specific value (real or string) is present within a circular area of a given ds_grid. If it is present the function will return true otherwise it will return false.


Example:

GML Code Example

if ds_grid_value_disk_exists(grid, 5, 5, 5, val)
    {
    xpos = ds_grid_value_disk_x(grid, 5, 5, 5, val);
    ypos = ds_grid_value_disk_y(grid, 5, 5, 5, val);
    }
 

The above code checks a ds_grid for a specific value within a disk region. if it is found, it then stores the x and y position of the value in two variables for later use.





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