Alternative to Nested Containers?

I want to have a container of sprites, but each of the sprites needs to have a bitmapText rendered in front of it and moving with it.

One method would be to have nested containers with the first level containers containing a sprite and its bitmapText and then a second level container containing all the first level containers.

Alternatively I could just have the bitmapTexts floating separately and just update their x and y co-ordinates in the update cycle to match their sprite.

Any idea which would be better or if there is another alternative I haven’t considered?

Thanks, Gordon

Here is my container game object plugin, which will transform position/angle/scale/alpha of children according to parent’s position/angle/scale/alpha. (Demo).

And here are some game objects plugin for ui.

1 Like

Thanks very much for the quick response. I guess you’ve suddenly got me thinking that all the complexity of the container is probably overkill for linking my sprite and bitmap text - I’m not planning on them rotating or changing scale or anything like that so using your liteContainer or none at all is probably going to be much more efficient.

Much appreciated and thanks for all the other links too - look very useful!