Newbrict / engi

Oaktales engi fork
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Add render order to RenderComponent/RenderSystem #20

Closed paked closed 9 years ago

paked commented 9 years ago

It is done so by Specifying the priority in the RenderComponent. RenderComponent.Priority can be either engi.Background, engi.MiddleGround or engi.Foreground). By default it is engi.MiddleGround.

paked commented 9 years ago

I don't quite know how happy I am with this current new Renderable based system...

paked commented 9 years ago

But it does work... and got rid of the switch-statement.

Newbrict commented 9 years ago

I still don't understand how maps would render all their layers like this. right now the entire level gets rendered to the middleground?

paked commented 9 years ago

@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.

Newbrict commented 9 years ago

Can you elaborate on restructuring the way maps work ?

paked commented 9 years ago

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.

Newbrict commented 9 years ago

Okay that sounds good to me.