class flixel.effects.FlxFlicker implements IFlxDestroyable
Available on all platforms
The retro flickering effect with callbacks. You can use this as a mixin in any FlxObject subclass or by calling the static functions. @author pixelomatic
Class Fields
static function flicker(Object:FlxObject, ?Duration:Float = 1, ?Interval:Float = 0.04f, ?EndVisibility:Bool = true, ?ForceRestart:Bool = true, ?CompletionCallback:FlxFlicker ->Void = null, ?ProgressCallback:FlxFlicker ->Void = null):Void
A simple flicker effect for sprites using a ping-pong tween by toggling visibility. * *
Object | The sprite. * |
Duration | How long to flicker for. * |
Interval | In what interval to toggle visibility. Set to FlxG.elapsed if <= 0! * |
EndVisibility | Force the visible value when the flicker completes, useful with fast repetitive use. * |
ForceRestart | Force the flicker to restart from beginnig, discarding the flickering effect already in progress if there is one. * |
?CompletionCallback | An optional callback that will be triggered when a flickering has finished. * |
?ProgressCallback | An optional callback that will be triggered when visibility is toggled. |
static function isFlickering(Object:FlxObject):Bool
Returns whether the object is flickering or not. *
Object | The object to test. |
static function stopFlickering(Object:FlxObject):Void
Stops flickering of the object. Also it will make the object visible. *
Object | The object to stop flickering. |
Instance Fields
function completionCallback(:FlxFlicker):Void
The callback that will be triggered after flicker has completed.
function progressCallback(:FlxFlicker):Void
The callback that will be triggered every time object visiblity is changed.