Search code examples
libgdxactor

LibGDX group within group


Is it possible to add a group to a group. I did that a while ago and it wasn't working at all. I wasn't sure what the reason was, so I did a workaround.

Now I think it would be way easier to do it the first way.

Group group = new Group();
Group otherGroup = new Group();
group.addActor(otherGroup);

This should work, right?


Solution

  • So I figured out what was wrong:

    I did override the draw method in "group", and I guess you have to call the draw methods of the children manually because once I removed the draw method in "group" everything worked fine...

    The same thing applies to the act(delta) method.

    All I had to do is call super.draw() and super.act() in the Group "group", now everything works fine.