Changed Display from one sprite per cell to sprite stack per cell.#276
Changed Display from one sprite per cell to sprite stack per cell.#276marcojulian wants to merge 1 commit into
Conversation
|
Hey! I really appreciate the PR and this is a really common request, so all great there. I'm thinking more about where this fits into the broader library. I think it's kind of nice that the default display is dead simple, but I'd be totally willing to include this in spectrum as well as say StackedDisplay or somesuch. I'll do a deeper dive and give more feedback tomorrow or the next day hopefully. Thanks so much for your contribution! |
|
Also any idea how this plays with Animations? |
|
Of course! Please keep in mind that this is a late Sunday night solution so I know there could be room for improvement before merging. I didn't test it with animations since I haven't implemented any in my game yet. But I could add a couple and let you know how it goes! |
|
Discussed it in the discord with @fingoltin he's open to making this the default. |
|
After testing it out we do need a way to enable the current behaviour. Maybe we try subclassing? |
e1bdf33 to
8d0c620
Compare
|
✔️ I repeated the same manual tests that I shared above after replacing Display with StackedDisplay in my own main.lua |




PR summary:
Displaynow supports layered sprites per cell, preserving terrain beneath transparent actor/item sprites while keeping existing depth ordering.Old behavior:
cell.charheld single tile.New behavior:
sprites = { ... }.put()appends sprite with depth/layer.draw()sorts cell sprites by depth and draws all.bgDepth, so sprite depth and bg depth no longer fight.clear()empties sprite stack each frame.Before:

After:
