Newbrict / engi

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

Render order #15

Closed Newbrict closed 9 years ago

Newbrict commented 9 years ago

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

paked commented 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.

Newbrict commented 9 years ago

@paked I agree it's a little hacked together right now, both should be done at the same time.

paked commented 9 years ago

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.

paked commented 9 years ago

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?

Newbrict commented 9 years ago

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

Newbrict commented 9 years ago

also, yes, a 2 step create batch then render batch makes sense

paked commented 9 years ago

@Newbrict i'd be happy to do render order

Newbrict commented 9 years ago

@paked feel free :+1: