Skip to main content

CrossFade

Kindclass
Packageshaders
Full nameshaders.CrossFade
Sourcesource/shaders/CrossFade.hx
ExtendsFlxSprite

Ghost sprite drawn behind a character when a cross fade note is hit.

Instances are pooled (#88): the constructor takes no arguments so the PlayState.grp*CrossFade groups can build them through FlxTypedGroup.recycle(), every per-spawn assignment lives in setup(), and a finished ghost is only kill()ed — it stays in its group as a dead member so the next spawn revives it instead of allocating a new sprite, frames copy, animation and fade callback.

Public methods​

new (constructor)​

function new()

View source

setup​

function setup(character:Character, isDad:Bool = true):Bool

Prepares this pooled ghost for character.

@param character the character whose current animation frame is copied. @param isDad true on the opponent side of the strum line (drift direction). @return false when the effect must be skipped (the character already draws a FlxTrail, or has no animation running); the caller then drops this instance from its pool.

ParameterTypeDefault
characterCharacter—
isDad (optional)Booltrue

View source

Internals​

Private / internal members
FieldTypeStatic
fadeCompleteFlxTween->Voidno
Method
function onFadeComplete(twn:FlxTween):Void