SDK GraphicEntityModule: misleading documentation+API surrounding Group

The SDK documentation is correct, in a way: the section title is “Creating a group of sprites” (emphasis mine).

But the GEM is perfectly happy to let me add any kind of Entity to a Group. And Text and Rectangle are valid entities to add to a group, Java-wise.

It’s all the more confusing that nothing reports any kind of error until they’re set up for animation, at which point… I don’t remember exactly, I made rectangle.png sprites to work around it; I think they just disappeared. But still no reported error. And a lot of wasted time looking around for where my entities could have gone.

FWIW, I think the createGroup() method javadoc oversells it:

Creates a new Group entity, its graphical counterpart will be created on the frame currently being computed.
A Group represents a collection of other entities. It acts as a container.

1 Like

All types of Entity can go inside a Group, not just Sprites.

Ok, then there’s a deeper bug.
I’ll try and reproduce it independently.

Ok thanks. Keep in my mind that a Group will update its list of children at the end of the current frame. Or before if you commit the group.

That’s what seemed natural to me too. :slightly_smiling_face: