fires once when a non-looping animation reaches its last frame
the packed additive colour; use setColorAdd or lerpTint rather than setting it raw
how long the current animation has been running, startTime and all
Where the current frame is drawn relative to the sprite's own position, in pixels. The caller
adds it, as in sprite.position.set(x + sprite.frameOffset.x, y + sprite.frameOffset.y). Both
are zero for a frame with no offset of its own.
Optionaloptions: AnimationOptionsPuts the halo where its target stands, with whatever offset it was built with. Call it whenever the target moves, or every frame - the halo's own position is never touched by its animation.
Moves the sprite strength of the way towards color, leaving its shading intact.
This sets both halves of the transform: the tint carries 1 - strength and the
additive term carries color × strength.
Starts an animation.
Playing the one already running does nothing, so a movement loop can call
play('walk') every frame without restarting it. Pass restart to force it.
back to the texture's own colours
each 0 to 1
extra alpha to add, usually 0
a solid silhouette in color, keeping only the sprite's shape
The glow around a unit, an aura, a shrine's light: an animated sprite that follows a target and is drawn additively.
It is an
AnimatedSprite, so frames may carry their own durations and offsets, andupdate(dt)advances it exactly as it advances any other animation. Two things are its own:follow, which applies the halo's offset once rather than in every game that draws one, and the blend mode.Z-order is the caller's, and that is not an oversight: a halo that should sit behind its unit is added before it (
container.addChild(glow, glow2, unit)), and one that should sit in front is added after. A framework that guessed would be wrong half the time, and a game that wants the glow to be part of the unit's own rotation adds it to the unit instead.Example