Quantcast
Channel: Pixi.js Latest Topics
Viewing all articles
Browse latest Browse all 3978

Combine multiple sprites into 1 sprite

$
0
0

I'am trying to create 5 sprites and combine them into 1 sprite only once. Then i create multiple objects and assign that 1 sprite to each one of those objects.

My idea is that each object has 5 properties like name, image etc.. and if i create 5 sprites per object then it will cause alot of draw calls and sometimes fps drops if the objects are too many, so iam trying to combine the 5 sprites into 1 sprite then add that sprite to each object and inside the object i want to be able to change the sprites inside the 1 parent sprite for each object while that 1 sprite is acting as if it was actually only 1 sprite, basically without adding the  5 sprites as children to 1 sprite.

 

1 - I wanna know if this is possible

2- if it is, I want to know how i would do it because iam kinda new to pixi and i dont know what to do

i have tried multiple ideas but all of them failed so i came here.


Viewing all articles
Browse latest Browse all 3978

Trending Articles