File tree Expand file tree Collapse file tree
src/gameobjects/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -507,10 +507,9 @@ var Animation = new Class({
507507
508508 /**
509509 * Takes a value between 0 and 1 and uses it to set how far this animation is through playback.
510- * Does not factor in repeats or yoyos.
510+ * Does not factor in repeats or yoyos, but does handle playing forwards or backwards .
511511 *
512512 * @method Phaser.GameObjects.Components.Animation#setProgress
513- * @todo
514513 * @since 3.4.0
515514 *
516515 * @param {float } [value=0] - [description]
@@ -519,6 +518,13 @@ var Animation = new Class({
519518 */
520519 setProgress : function ( value )
521520 {
521+ if ( ! this . forward )
522+ {
523+ value = 1 - value ;
524+ }
525+
526+ this . setCurrentFrame ( this . animationManager . getFrameByProgress ( value ) ) ;
527+
522528 return this . parent ;
523529 } ,
524530
You can’t perform that action at this time.
0 commit comments