The retro flickering effect with callbacks. You can use this as a mixin in any FlxObject subclass or by calling the static functions.
staticflicker(Object:FlxObject, Duration:Float = 1, Interval:Float = 0.04, EndVisibility:Bool = true, ForceRestart:Bool = true, ?CompletionCallback:FlxFlicker ‑> Void, ?ProgressCallback:FlxFlicker ‑> Void):FlxFlicker
A simple flicker effect for sprites using a ping-pong tween by toggling visibility.
How long to flicker for (in seconds).
In what interval to toggle visibility. Set to
Force the visible value when the flicker completes, useful with fast repetitive use.
Force the flicker to restart from beginning, discarding the flickering effect already in progress if there is one.
An optional callback that will be triggered when a flickering has finished.
An optional callback that will be triggered when visibility is toggled.
Returns whether the object is flickering or not.
The object to test.
The flicker timer. You can check how many seconds has passed since flickering started etc.
read onlycompletionCallback:FlxFlicker ‑> Void
The callback that will be triggered after flicker has completed.