Image#subimage
is extremely fast. So fast that you could recreate the subimages every tick, draw them once, and then discard them.Image#subimage
and loading an image via the constructor is that the latter will add padding around the image when copying it to an OpenGL texture. Those pixels will either be translucent (default) or repeat the outermost colour values (tileable: true
). That ensures that the image looks good when scaling, rotating etc.subimage
, it is your responsibility to make sure the images have some padding. (If you use retro: true
, this doesn't matter.)load_tiles
or subimage
depending on what suits you better.Image.load_tiles
) dynamically build a tile atlas on 1024x1024px GL textures. You can observe whether images end up on the same texture internally by comparing image.gl_tex_info.tex_name
.
subimage
will stop working. (This is actually a limitation that I could work around. Hmm. Maybe in a future version...) You could add a check for that in the constructor to prevent surprises.
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill