mwg API
    Preparing search index...

    Function packColorAdd

    • Packs an additive colour into the form the attribute expects.

      Parameters

      • r: number

        red, 0 to 1

      • g: number

        green, 0 to 1

      • b: number

        blue, 0 to 1

      • a: number = 0

        how much to add to the sprite's own alpha, 0 to 1; usually 0

      Returns number

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

      declare const rat: TintedSprite;

      rat.colorAdd = packColorAdd(0, 1, 0); // pull the sprite towards pure green