Skip to content
Browse files

added a progress getter to the timer class

  • Loading branch information...
1 parent 69eb96e commit f4cdc4204d6c38c809138ca26599b9b863d67ba3 @AdamAtomic committed
Showing with 11 additions and 0 deletions.
  1. +11 −0 org/flixel/FlxTimer.as
View
11 org/flixel/FlxTimer.as
@@ -149,6 +149,17 @@ package org.flixel
return loops-_loopsCounter;
}
+ /**
+ * Read-only: how far along the timer is, on a scale of 0.0 to 1.0.
+ */
+ public function get progress():Number
+ {
+ if(time > 0)
+ return _timeCounter/time;
+ else
+ return 0;
+ }
+
static public function get manager():TimerManager
{
return FlxG.getPlugin(TimerManager) as TimerManager;

0 comments on commit f4cdc42

Please sign in to comment.
Something went wrong with that request. Please try again.