Merge spritesheets into one image

Hi, i dont know if this can be done with render texture or something other but how can i merge multiple spritesheets into one using phaser. I have for example player body, hair, clothes, accessories… if i render all images for each player and npc i will probably face with performance problem at the somne time.
Without phaser before i was on player/npc creation/change in separated canvas draw whole images together and save in dir like temp files for later use so i can draw only one image and not 10 for each update or using node back process to merge images from folder, depends on project.

But how can i do that with phaser, im new and im sure that it probably have some build in function for that but i cant find it yet.

Example of images that i want to merge in order to make npc variations and player equips

image image ![image|133x173]image

image

Something like

const rt = this.make.renderTexture({ width: 131, 187 });
const texture = rt.save('player');

texture.add('down1', 0, x, y, width, height);
texture.add('down2', 0, x, y, width, height);
// etc.
2 Likes

Thank you! That is also what i was tried but somehow it was way to simple and easy so i thought probably is something wrong xD

1 Like