Skip to content

Systems

Pixi render systems run in a fixed chain. Transform groups are allocated before sprite and text nodes are created. Concrete nodes are created before generic transform, size, and pivot synchronization.

The transform hot path queries only PixiTransformGroup and canonical transform/layout components. Each group resolves directly to a dense array of PixiJS Container objects, so one transform update can be applied to every render role without an entity lookup or concrete node-type branch, but one: a nine-slice sizes its own width and leaves its scale, so a Size gives it the scale’s sign every sync.

Adding another PixiJS Container implementation requires:

  1. Define a serializable render-intent component that requires PixiTransformGroup.
  2. Add a role for the concrete PixiJS node to the existing registry group.
  3. Increment PixiTransformGroup.revision.
  4. Synchronize role-specific properties through the registry role.
  5. Remove the role synchronously from a component-removal callback.
  6. For a component a sync applies, say what the node is without it in PixiNodeRegistry’s without list: a sync applies a component when it changes, and nothing else tells the node it is gone.

The revision change causes the existing generic systems to apply current transform, Size, and Pivot values to a newly attached node even when those values did not otherwise change.

CameraFollow runs before the chain, in Schedule.PreRender after the transforms are interpolated and propagated, and moves each camera to its CameraTarget. CameraSync, first in the chain, puts the world container where the camera’s view is: its fit to the screen, its zoom and its shake.

Every system of the chain but the last is in the system set PixiSyncSet, and the last, which draws the frame, in PixiDrawSet. A system of another package that places nodes itself is registered in Schedule.Render with .after(PixiSyncSet).before(PixiDrawSet).

Cleanup is role-specific. Removing Sprite destroys only the sprite, while removing Text destroys only the text. Group removal and world/scene teardown destroy every remaining node exactly once without waiting for another render tick.