Skip to content
Avetis edited this page Nov 9, 2015 · 1 revision

This is a separate part to the main Ashley part of this runtime. It allows you to render overlap2d exported items, using standard Scene2D of libGDX. Basically it will convert a big nested data of items, into one Actor or Group that contains all of them, that if added to a stage, will render it all.

How to use

It all happens via one class, CompositeActor. All it needs a VO of a composite item to render. VO can be retrieved using ResourceManager, either from the scene or from library data. (So you can pass either the root element of the scene, or some small mini element that you previously added to editor library) Once created, if added to Stage via "add" method, it will be rendered.

When to use

Main uses case is UI. You can render things like dialogs, buttons and so on. Sometimes you want to have CompositeActor to render entire scene. Sometimes you want to do it partly. For example if you need a dialog with list of items inside. You can make two library items, one for dialog background/buttons, the other for one row of in-dialog items. Then you can make one CompositeActor for outer dialog, add standard libgdx ScrollView, and then in it put a table or list, and in it start adding CompositeActors for each row.

There might be other implications and uses cases. Creativity is your limit.