mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 13:43:26 +00:00
Allow animation speed greater than 0
This commit is contained in:
parent
f2daaec98c
commit
118d2057c0
1 changed files with 3 additions and 3 deletions
|
@ -768,19 +768,19 @@ Object.defineProperty(Phaser.Animation.prototype, 'frame', {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Phaser.Animation#speed
|
* @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', {
|
Object.defineProperty(Phaser.Animation.prototype, 'speed', {
|
||||||
|
|
||||||
get: function () {
|
get: function () {
|
||||||
|
|
||||||
return Math.round(1000 / this.delay);
|
return 1000 / this.delay;
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
set: function (value) {
|
set: function (value) {
|
||||||
|
|
||||||
if (value >= 1)
|
if (value > 0)
|
||||||
{
|
{
|
||||||
this.delay = 1000 / value;
|
this.delay = 1000 / value;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue