Carries the additive colour for one renderable.
Anything drawn through this batcher may set colorAdd on itself; anything that does not is packed with zero and renders exactly as it would have with the default batcher.
colorAdd
import type { HasColorAdd } from '@datamoc/mw_games/two-d/render';import { packColorAdd } from '@datamoc/mw_games/two-d/render';function tintTowardsWhite(renderable: HasColorAdd, strength: number): void { renderable.colorAdd = packColorAdd(strength, strength, strength);} Copy
import type { HasColorAdd } from '@datamoc/mw_games/two-d/render';import { packColorAdd } from '@datamoc/mw_games/two-d/render';function tintTowardsWhite(renderable: HasColorAdd, strength: number): void { renderable.colorAdd = packColorAdd(strength, strength, strength);}
Optional
additive colour, packed as 0xAABBGGRR to match the attribute's byte order
Carries the additive colour for one renderable.
Anything drawn through this batcher may set
colorAddon itself; anything that does not is packed with zero and renders exactly as it would have with the default batcher.Example