Skip to content

FXLayer Pixi Layer#105

Merged
1brucben merged 3 commits into
v0.2.0from
layers1
Nov 19, 2025
Merged

FXLayer Pixi Layer#105
1brucben merged 3 commits into
v0.2.0from
layers1

Conversation

@1brucben
Copy link
Copy Markdown
Owner

This pull request refactors the FX (effects) rendering system in the client graphics codebase to use PixiJS for all FX rendering, replacing direct Canvas2D drawing. The changes introduce a new architecture where FX are represented as Pixi display objects, managed in a dedicated FxLayer with proper positioning and lifecycle management. This enables more advanced visual effects and paves the way for future improvements in performance and maintainability.

Major migration to PixiJS for FX rendering:

  • Refactored the Fx interface and all FX classes (SpriteFx, FadeFx, ShockwaveFx, UnitExplosionFx) to use PixiJS containers and rendering primitives instead of Canvas2D methods. Each FX now exposes a getDisplayObject() method returning a Pixi container for rendering. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]
  • Updated the AnimatedSpriteLoader to provide PixiJS textures and configuration for FX sprites, supporting colored and regular animated sprites. [1] [2]

New FX layer architecture:

  • Implemented a new FxLayer that manages all FX as PixiJS display objects, including initialization of a PixiJS renderer and stage, and mapping FX to world coordinates for correct screen positioning. Added logic to handle window resizing and FX lifecycle. [1] [2] [3] [4]

Integration and API changes:

  • Changed the creation and management of FX in game event handlers to use the new FxLayer API, passing world coordinates and handling FX addition/removal via PixiJS containers. [1] [2]
  • Updated the GameRenderer to instantiate FxLayer with the required TransformHandler and adjusted the layer rendering loop to accommodate the new rendering approach. [1] [2]

These changes collectively modernize the FX rendering pipeline, making it more extensible and visually capable.

@1brucben 1brucben merged commit f93604f into v0.2.0 Nov 19, 2025
5 of 7 checks passed
@El-Magico777 El-Magico777 added this to the v0.1.11 milestone Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants