Search code examples
lualove2d

Create one large image out of many small ones? LÖVE


Is it posible to create a drawable object out of some other drawable objects? And How would I do it?


Solution

  • Use a Canvas and draw the smaller images into it.

    bigger = love.graphics.newCanvas(100, 100)
    bigger:renderTo(function() 
          -- draw images here using love.graphics.draw etc...
    
          end)
    

    and then later use the canvas instead of the smaller images:

    love.graphics.draw(bigger)