Hello everyone. Ever since I started with GameMaker, many years ago, there are a few functions I have always wished that I could modify.
Here are the two functions in their current definitions.
draw_sprite_tiled_ext(sprite, index, x, y, xscale, yscale, blend, alpha);
draw_background_tiled_ext(background, x, y, xscale, yscale, blend, alpha);
Here are the two functions, modified.
draw_sprite_tiled_ext(sprite, index,x,y,xscale, yscale, blend, alpha, hrepeat,vrepeat);
draw_background_tiled_ext(background, x, y, xscale, yscale, blend, alpha, hrepeat,vrepeat);
I'd rather have
draw_sprite_tiled_ext(sprite, index, x, y, xscale, yscale, blend, alpha, amount_of_tiles_on_left, amount_of_tiles_on_top, amount_of_tiles_on_right, amount_of_tiles_on_bottom);
draw_background_tiled_ext(background, x, y, xscale, yscale, blend, alpha, amount_of_tiles_on_left, amount_of_tiles_on_top, amount_of_tiles_on_right, amount_of_tiles_on_bottom); The point is, the tiled functions fill the entire room. I'd rather they just fill the playing field. Then I don't have to cover up everything that it draws that I don't need everytime I use one of these functions.
The idea is that you select one cell and then can extend however many cells you need in each of the four directions. So all four extra arguments to zero means you see only one tile. left = 0, top = 0 means the x and y indicate the left-top-most tile. left = 1 means the x indicates the second-left tile. right = 0 means the x indicates the rightmost tile. I guess you get the idea. One example,
draw_sprite_tiled_ext(sprite, index, x, y, xscale, yscale, blend, alpha, 5, 3, 20, 15);means it draws the tile at the given x, y position, then five columns left of it and 20 right of it, and then three rows on top and 15 below. So in total this would draw 5 + 1 + 20 = 26 columns and 3 + 1 + 15 = 19 rows, totalling 494 tiles, where the original x, y position incates the fourth row and the sixth column.
That way you have all freedom you could ever need (except rotation).
Need to expand it all over the room?
draw_sprite_tiled_ext(sprite, index, x, y, xscale, yscale, blend, alpha, x div w, y div h, (room-width - x) div w, (room_height - y) div h);