Skip to content

Commit b34860c

Browse files
author
gotenxds
committed
Reverse and reverseOnce will now return the animation to allow linking.
1 parent d243da7 commit b34860c

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/animation/Animation.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ Phaser.Animation.prototype = {
247247
* Reverses the animation direction
248248
*
249249
* @method Phaser.Animation#reverse
250+
* @return {Phaser.Animation} The animation instance.
250251
* */
251252
reverse: function () {
252253
this.reversed = !this.reversed;
@@ -258,6 +259,7 @@ Phaser.Animation.prototype = {
258259
* the reversed state.
259260
*
260261
* @method Phaser.Animation#reverseOnce
262+
* @return {Phaser.Animation} The animation instance.
261263
* */
262264
reverseOnce: function () {
263265
this.reverse();

typescript/phaser.comments.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,14 +260,14 @@ declare module "phaser" {
260260
/**
261261
* Toggels the animation direction
262262
*/
263-
reverse(): void;
263+
reverse(): Animation;
264264

265265
/**
266266
* Reverses the animation direction for the current/next animation only
267267
* Once the onComplete event is called this method will be called again and revert
268268
* the reversed state.
269269
*/
270-
reverseOnce(): void;
270+
reverseOnce(): Animation;
271271

272272

273273
/**

typescript/phaser.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ declare module "phaser" {
9191
play(frameRate?: number, loop?: boolean, killOnComplete?: boolean): Phaser.Animation;
9292
previous(quantity?: number): void;
9393
restart(): void;
94-
reverse(): void;
95-
reverseOnce(): void;
94+
reverse(): Animation;
95+
reverseOnce(): Animation;
9696
setFrame(frameId?: string | number, useLocalFrameIndex?: boolean): void;
9797
stop(resetFrame?: boolean, dispatchComplete?: boolean): void;
9898
update(): boolean;

0 commit comments

Comments
 (0)