mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 23:20:59 +00:00
Merge pull request #2664 from jayrobin/fix-fractional-anim-speed
Allow animation speed greater than 0
This commit is contained in:
commit
435ff9a420
1 changed files with 3 additions and 3 deletions
|
@ -768,19 +768,19 @@ Object.defineProperty(Phaser.Animation.prototype, 'frame', {
|
|||
|
||||
/**
|
||||
* @name Phaser.Animation#speed
|
||||
* @property {number} speed - Gets or sets the current speed of the animation in frames per second. Changing this in a playing animation will take effect from the next frame. Minimum value is 1.
|
||||
* @property {number} speed - Gets or sets the current speed of the animation in frames per second. Changing this in a playing animation will take effect from the next frame. Value must be greater than 0.
|
||||
*/
|
||||
Object.defineProperty(Phaser.Animation.prototype, 'speed', {
|
||||
|
||||
get: function () {
|
||||
|
||||
return Math.round(1000 / this.delay);
|
||||
return 1000 / this.delay;
|
||||
|
||||
},
|
||||
|
||||
set: function (value) {
|
||||
|
||||
if (value >= 1)
|
||||
if (value > 0)
|
||||
{
|
||||
this.delay = 1000 / value;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue