mazoku Posted January 12, 2020 Share Posted January 12, 2020 (edited) Question in topic. I think this is pretty useful, its overhead to make a container to have image + text functionality (Button) for example. Or am I missing something? Edited January 12, 2020 by mazoku information Link to comment Share on other sites More sharing options...
rich Posted January 12, 2020 Share Posted January 12, 2020 It’s more overhead for every single Game Object to be a container. How many buttons does a typical game contain vs. things like bullets, platforms, particles, baddies, power-ups, etc etc. Link to comment Share on other sites More sharing options...
mazoku Posted January 12, 2020 Author Share Posted January 12, 2020 I admit this is a nice answer. Link to comment Share on other sites More sharing options...
MirroW Posted January 14, 2020 Share Posted January 14, 2020 On 1/12/2020 at 6:23 PM, rich said: It’s more overhead for every single Game Object to be a container. How many buttons does a typical game contain vs. things like bullets, platforms, particles, baddies, power-ups, etc etc. It sounds like it would be bad practice to use containers in Phaser 3, is that the case? Say I don't nest them at all, just use them to define more complex Game Objects that require layered sprites. So an example would be to have 10 moving sprites, compared to 10 moving containers (with 1 sprite child) (without physics). Link to comment Share on other sites More sharing options...
rich Posted January 14, 2020 Share Posted January 14, 2020 There's nothing wrong with using Containers in Phaser 3. The example given by mazoku (a UI Button) is a perfect use-case for them. As are multi-part sprites, i.e. complex Game Objects. But if a Container has just a single child, that's when it doesn't usually make sense any more. MirroW 1 Link to comment Share on other sites More sharing options...
Recommended Posts