Closed paked closed 9 years ago
I don't quite know how happy I am with this current new Renderable based system...
But it does work... and got rid of the switch-statement.
I still don't understand how maps would render all their layers like this. right now the entire level gets rendered to the middleground?
@Newbrict I think that is more of a map issue, and by extension outside the scope of this PR. My thoughts on implementing this would be to restructure the way map's work.
Can you elaborate on restructuring the way maps work ?
Currently maps are represented a single struct. We perhaps need to introduce a new type into engi of a Group
. Using a group we break the map down into separate entities (foreground, middle ground, scenic ground, background) each with a different tilemap/layer component. When the RenderSystem comes across a group entity it should (instead of adding the entity straight to the RenderSystem.renders
map) scan through it's sub-entities and add them to the RenderSystem.renders
map.
This would require more restructuring... But we are inevitably going to have to add a Group
type anyway. Again, I would suggest doing this in a separate PR.
Okay that sounds good to me.
It is done so by Specifying the priority in the
RenderComponent
.RenderComponent.Priority
can be eitherengi.Background
,engi.MiddleGround
orengi.Foreground
). By default it isengi.MiddleGround
.