Render order (layers) using a Graphiclist


(Joseph Sweeney) #1

So I’m fiddling with some “3D” rendering using FlashPunk - never learned 3D in my life, just seeing what I can make. Honestly it’s more 2.5D than 3D since all of the Images only rotate around one axis. I have a special Wall class that extends a Tilemap and can be scaled in the X direction depending on the screen rotation. This all works fine.

Thing is, I’m treating each Wall as a Graphic, with each entity holding multiple walls and rendering them using a Graphiclist. Obviously the major problem here is render depth - while it’s easy enough to detect render order, graphiclists lack built-in layering.

What do you think? Should I customize the FP library to handle render distance, or make each wall a separate entity?


(Zachary Lewis) #2

You can specify an Entity's layer , but the only way to reorder a Graphiclist is manually. I’d start with an Entity-based approach at first, and if you get it working right, try to migrate it to Graphiclist if it will speed things up.


(Ultima2876) #3

Entities should be absolutely fine performance-wise; they don’t actually do a whole lot more than a graphics list does itself so there should be very little overhead vs a single entities with a graphiclist full of walls that you have had to sort yourself.


(Joseph Sweeney) #4

OK, I will go ahead and choose the Entity approach. I guess it wasn’t as big a deal as I was making it. I’d still like to use the walls as graphics only, not entities in the normal sense, so I think I will just override the containing entity’s render code to render each wall entity it contains.