jamespierce Posted August 7, 2021 Share Posted August 7, 2021 Hi PixiJS Devs! I don't know how to handle different states (Example states are: Intro, Main Menu, Game, Settings). I found 10 year old posts saying to use DisplayObjectContainers for each stage / scene / state. Source: https://github.com/pixijs/pixijs/issues/153 Is that still accurate today with PixiJS? I'm afraid to create a new stage, wipe it, and then not notice that it's slowly clumping up the memory as the game goes on. Is it really that easy to change & manage game states? 1) Create a container for each state/scene 2) Wipe all visuals 3) Start drawing new stuff Thanks in advance! Quote Link to comment Share on other sites More sharing options...
Yeferson Posted August 7, 2021 Share Posted August 7, 2021 Hello, Yes, the scenes or states are managed with DisplayContainer in Pixijs. This is an excellent example: https://javascript.plainenglish.io/scenes-in-pixijs-1ee4b0af5116 jamespierce and ivan.popelyshev 2 Quote Link to comment Share on other sites More sharing options...
jamespierce Posted August 8, 2021 Author Share Posted August 8, 2021 Thank you Yeferson, that's exactly what I've been looking for! Appreciate it. Yeferson 1 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.