Skip to content

Commit

Permalink
Add FlxFlicker.pause() and FlxFlicker.resume()
Browse files Browse the repository at this point in the history
  • Loading branch information
EliteMasterEric committed Jun 12, 2024
1 parent 00a45c8 commit 80245d2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions flixel/effects/FlxFlicker.hx
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,22 @@ class FlxFlicker implements IFlxDestroyable
timer = new FlxTimer().start(interval, flickerProgress, Std.int(duration / interval));
}

/**
* Temporarily pause the flickering, so it can be resumed later.
*/
public function pause():Void {
if (timer == null) return;
timer.active = false;
}

/**
* Resume the flickering after it has been temporarily paused.
*/
public function resume():Void {
if (timer == null) return;
timer.active = true;
}

/**
* Prematurely ends flickering.
*/
Expand Down

0 comments on commit 80245d2

Please sign in to comment.