I'm not going to use legs and arms, they are attached to the body in the atlas file.
Inside the game I was placing the head on top of the body, and move it with the body.
I math.floor(everything + 0.5) but sometimes I see a small glitch.
For me the only solid safe solution in my opinion at the moment is, not adding body parts like this, and make a bigger atlas (with all options).
But then I need to do two things (that I don't want).
1. change photoshop files
2. create bigger atlas files (not really a problem)
So then I thought, why not create the full body + head inside the game?
It cost a little more memory, but then I can remove code that I was using to attach the body parts, and there is never a glitch.
Is ImageData:paste() the way to go, to merge two quads inside the memory?
Or are there other ways that are better, to do this?
Code: Select all
-- i use quad to read the atlas and frames
local quad_body = newQuad()
local quad_head = newQuad()
-- is ImageData:paste the thing that I have to use to merge to images together?
-- and if that is the case, and have the final quad_merged, then I can destroy the atlas.resource
quad_merged = ImageData:paste()
-- in the draw
love.graphics.draw(atlas.resource, quad_merged, x, y)