CptnRuby.rb example. It has a tile map, and you could stamp tiles by just putting them in the tile array at the right place. Level editors usually work this way.
@tiles=Window.record(map_width, map_height) do
## draw tiles here
end@tiles as image.
# Lets say that my_image is a 100x100 size image, and we want to stamp it 10x10 times
for x in 1..10
for y in 1..10
w, h = my_image.width, my_image.height
# Multiply the sizes so the "stamps" don't overlap
my_image.draw(x * w, y * h, 0)
end
end
Powered by mwForum 2.29.0 © 1999-2013 Markus Wichitill