CrossFade
| Kind | class |
| Package | shaders |
| Full name | shaders.CrossFade |
| Source | source/shaders/CrossFade.hx |
| Extends | FlxSprite |
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()
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.
| Parameter | Type | Default |
|---|---|---|
character | Character | — |
isDad (optional) | Bool | true |
Internals
Private / internal members
| Field | Type | Static |
|---|---|---|
fadeComplete | FlxTween->Void | no |
| Method |
|---|
function onFadeComplete(twn:FlxTween):Void |