ds_grid_value_exists


描述

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


语法:

ds_grid_value_exists(index, x1, y1, x2, y2, val);

参数 描述
index 栅格的索引
x1 栅格内区域左端x位置。
y1 栅格内区域顶端的y位置。
x2 栅格内区域右端x位置。
y2 栅格内区域底端的y位置。
val The value to find.


Returns:

Boolean


例如:

if ds_grid_value_exists(grid, 0, 1, 5, 6, val)
   {
   xpos = ds_grid_value_x(grid, 0, 1, 5, 6, val);
   ypos = ds_grid_value_y(grid, 0, 1, 5, 6, val);
   }

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