Closed Newbrict closed 9 years ago
While we are at it, perhaps we need to rethink the way RenderSystem
works. Abstract into an interface (Drawable
perhaps) instead of a switch statement for everything.
@paked I agree it's a little hacked together right now, both should be done at the same time.
Have you got any ideas for this @Newbrict. I'm personally thinking we add a value to RenderComponent
, which is like Priority
and then store a map[priority][]Entity
and iterate over that at update... at least that would make sense. However the ECS system doesn't really allow that.
On second thought... What if we used RenderSystem.Update(..)
as an assembler for the render order (create a map of priorities/entities) and then in the RenderSystem.Post()
method actually do the rendering?
Things should render in the same order every time, so my initial thoughts were to define the render order for each component ( background, foreground, gui, whatever else ) then have priorities within each of those that determine their render order within their groups
also, yes, a 2 step create batch then render batch makes sense
@Newbrict i'd be happy to do render order
@paked feel free :+1:
We need a way to support rendering order
ie render an image behind a platform, render an image in front of a platform, render an image in front of the player, background scrolling levels, etc