This function can be used to copy the contents of a rectangular area of grid cells from one (previously defined) ds_grid to another, or it can be used to copy a region from within the same grid. The following images illustrate both ways that this function can be used:
ds_grid_set_grid_region(index, source, x1, y1, x2, y2, xpos, ypos);
参数 | 描述 |
---|---|
index | 靶栅格的索引 |
source | 源栅格的索引 |
x1 | 从源栅格复制的单元格区域的左端位置 |
y1 | 从源栅格复制的单元格区域的顶端位置 |
x2 | 从源栅格复制的单元格区域的右端位置 |
y2 | 从源栅格复制的单元格区域的底端位置 |
xpos | The x position on the destination grid to copy the source region to. |
ypos | The y position on the destination grid to copy the source region to. |
N/A(无返回值)
ds_grid_set_grid_region(grid, t_grid, 0, 0, 5, 5,
10, 10)
This would copy the region of cells from (0,0) to (5,5) of the grid indexed in the variable "t_grid" and copy them to position (10,10) in the grid indexed in the variable "grid".