mwg API
    Preparing search index...

    Function registerColorTransform

    • Registers the colour-transform batcher and the TintedSprite pipe with Pixi.

      TintedSprite.ts calls this itself, at module scope, the moment anything imports it (directly, or transitively through AnimatedSprite/TileMap/DialogueStage, all built on it) - registration has to happen before the renderer is created, and an ES module's top-level code always runs before whatever imports it goes on to call new Game()/ Game.start(), so a game never has to know this pipe exists, let alone pass it through GameOptions.extensions itself. This stays exported, idempotent (registered guards a second call from double-adding it), and public for the rare case of a game building its own renderer setup outside Game.

      Returns void

      import { registerColorTransform } from '@datamoc/mw_games/two-d/render';

      // a game that assembles its own Pixi renderer extensions manually, instead of going
      // through `Game`/`GameOptions.extensions`, registers the batcher itself before creating
      // that renderer - importing `TintedSprite` (directly or transitively) already does this,
      // so most games never call it
      registerColorTransform();