ds_grid_swap_columns
Exchanges the contents of two entire grid columns.
G=AEIM​BFJN​CGKO​DHLP​​f(G,0,2)=CGKO​BFJN​AEIM​DHLP​​
- ds_grid_swap_columns(grid, col1, col2)
- Exchanges the contents of two entire grid columns.
COPY/// @func ds_grid_swap_columns(grid, col1, col2)
///
/// @desc Exchanges the contents of two entire grid columns.
///
/// @param {grid} grid grid data structure
/// @param {real} col1 1st column of the exchange
/// @param {real} col2 2nd column of the exchange
///
/// GMLscripts.com/license
function ds_grid_swap_columns(grid, col1, col2)
{
for (var i=0; i<ds_grid_height(grid); i++) {
var temp = ds_grid_get(grid, col1, i);
ds_grid_set(grid, col1, i, ds_grid_get(grid, col2, i));
ds_grid_set(grid, col2, i, temp);
}
}
Contributors: Quimp
Related: ds_grid_delete_column, ds_grid_delete_row, ds_grid_draw, ds_grid_duplicate, ds_grid_filter_gaussian, ds_grid_filter_gaussian_wrap, ds_grid_flood_fill, ds_grid_get_bicubic, ds_grid_get_bilinear, ds_grid_mirror, ds_grid_swap_columns, ds_grid_swap_rows, ds_grid_translate
GitHub: View · Commits · Blame · Raw