Jump to content

Combine multiple sprites into 1 sprite


sosx
 Share

Recommended Posts

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.

Link to comment
Share on other sites

i create 5 sprites per object then it will cause alot of draw calls and sometimes fps drops if the objects are too many

> my problem is accessing one of the 5 combined sprites after they have been combined together in 1 sprite

then you have to debug and find what exactly is slow there.

Link to comment
Share on other sites

all of the 5 sprites are slow, thats why i thought of turning them all into 1 sprite which really improves the performance so much, so i just want to know if i could access one of the 5 sprites when they are combined together, or maybe recombine all of the 5 sprites per frame with the new texture

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...