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.