sosx Posted December 24, 2020 Share Posted December 24, 2020 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. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted December 24, 2020 Share Posted December 24, 2020 (edited) renderTexture. or is it about tilemap again? Edited December 24, 2020 by ivan.popelyshev Quote Link to comment Share on other sites More sharing options...
sosx Posted December 24, 2020 Author Share Posted December 24, 2020 Ye rendertexture is the perfect solution but my problem is accessing one of the 5 combined sprites after they have been combined together in 1 sprite Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted December 24, 2020 Share Posted December 24, 2020 > 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. Quote Link to comment Share on other sites More sharing options...
sosx Posted December 24, 2020 Author Share Posted December 24, 2020 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.