Background
Alpha transparency is not applied correctly in the current Pygame surface layer-based implementation. The root cause is that blit ordering between surfaces and transparency compositing are not properly controlled.
Proposed Changes
- Preprocess draw calls and push them onto a stack instead of executing them directly from the engine
- Pop from the stack in z-order and render sequentially
- This allows control over which artist is visible first and which one appears on top
- Reduce dependency on surface layers and handle blitting at the artist level
- Define the role of layers as a logical z-order offset for the user
Implementation Approach
- Replace the per-layer
_surface_dict with a single SRCALPHA render surface (+ a separate graph cache surface)
- Each frame: clear the render surface → blit graph cache onto it → draw all other artists in layer (z-order) order onto the same surface → blit render surface onto screen
- Layers are a z-order sorting key, not tied to separate surfaces
- Graph cache only redraws on camera move/zoom, everything else redraws each frame
Relevant Files (expected)
- pygame_engine.py
- render_manager.py
Closes
Background
Alpha transparency is not applied correctly in the current Pygame surface layer-based implementation. The root cause is that blit ordering between surfaces and transparency compositing are not properly controlled.
Proposed Changes
Implementation Approach
_surface_dictwith a singleSRCALPHArender surface (+ a separate graph cache surface)Relevant Files (expected)
Closes