Skip to content
Avetis edited this page Nov 9, 2015 · 4 revisions

I am assuming you already know what Ashley is, and how to work with it, if not, head to their wiki first and come back here when you do.

In short. Ashley will provide you with engine that you need to update on each of your render calls. Engine consists of many entities, that are empty containers that hold no data. Each entity in overlap2D will represent an item on the scene, like image or so. Each entity contains Components that describe it. And then Engine contains Systems that work with entities on each iteration based on their components.

The rendering itself is done by one of the systems that is responsible for rendering. It is iterating over the root-most entity on the nested structure, and goes deep in.

Now of course this entire big structure of entities, components and systems is created by Overlap2D. First when you create SceneLoader it prepares en empty engine, and adds all the default Overlap2D systems to it. They do nothing as there is no entities to iterate over. When loadScene is called. SceneLoader is asking EntityFactory to create the root most element based on it's VO data from JSON. The root entity contains Viewport component which is the camera for rendering. It then goes on recursively deep to create all the other entities.

Default Item Components

While creating Entities, ComponentFactory kicks in, and creates all components based on the item types. Here is the list of components that Overlap2D puts on them. *