mirror of
https://github.com/photonstorm/phaser
synced 2024-11-26 22:52:14 +00:00
Type definition fixes
This commit is contained in:
parent
8bc4d06831
commit
ef558fea3c
6 changed files with 25 additions and 28 deletions
|
@ -583,7 +583,7 @@ var Animation = new Class({
|
|||
// Yoyo? (happens before repeat)
|
||||
if (component._yoyo)
|
||||
{
|
||||
this._handleYoyoFrame(component, false);
|
||||
this.handleYoyoFrame(component, false);
|
||||
}
|
||||
else if (component.repeatCounter > 0)
|
||||
{
|
||||
|
@ -605,39 +605,45 @@ var Animation = new Class({
|
|||
}
|
||||
else
|
||||
{
|
||||
this._updateAndGetNextTick(component, frame.nextFrame);
|
||||
this.updateAndGetNextTick(component, frame.nextFrame);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Handle the yoyo functionality in nextFrame and previousFrame methods.
|
||||
*
|
||||
* @method Phaser.Animations.Animation#_handleYoyoFrame
|
||||
* @method Phaser.Animations.Animation#handleYoyoFrame
|
||||
* @private
|
||||
* @since 3.12.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.Components.Animation} component - The Animation Component to advance.
|
||||
* @param {bool} isReverse - Is animation in reverse mode? (Default: false)
|
||||
* @param {boolean} isReverse - Is animation in reverse mode? (Default: false)
|
||||
*/
|
||||
_handleYoyoFrame: function (component, isReverse)
|
||||
handleYoyoFrame: function (component, isReverse)
|
||||
{
|
||||
if (!isReverse) { isReverse = false; }
|
||||
|
||||
if (component._reverse === !isReverse && component.repeatCounter > 0)
|
||||
{
|
||||
component.forward = isReverse;
|
||||
|
||||
this.repeatAnimation(component);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (component._reverse !== isReverse && component.repeatCounter === 0)
|
||||
{
|
||||
this.completeAnimation(component);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
component.forward = isReverse;
|
||||
var frame = isReverse ? component.currentFrame.nextFrame : component.currentFrame.prevFrame;
|
||||
this._updateAndGetNextTick(component, frame);
|
||||
|
||||
var frame = (isReverse) ? component.currentFrame.nextFrame : component.currentFrame.prevFrame;
|
||||
|
||||
this.updateAndGetNextTick(component, frame);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -673,7 +679,7 @@ var Animation = new Class({
|
|||
|
||||
if (component._yoyo)
|
||||
{
|
||||
this._handleYoyoFrame(component, true);
|
||||
this.handleYoyoFrame(component, true);
|
||||
}
|
||||
else if (component.repeatCounter > 0)
|
||||
{
|
||||
|
@ -696,22 +702,23 @@ var Animation = new Class({
|
|||
}
|
||||
else
|
||||
{
|
||||
this._updateAndGetNextTick(component, frame.prevFrame);
|
||||
this.updateAndGetNextTick(component, frame.prevFrame);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Update Frame and Wait next tick
|
||||
* Update Frame and Wait next tick.
|
||||
*
|
||||
* @method Phaser.Animations.Animation#_updateAndGetNextTick
|
||||
* @method Phaser.Animations.Animation#updateAndGetNextTick
|
||||
* @private
|
||||
* @since 3.12.0
|
||||
*
|
||||
* @param {Phaser.Animations.AnimationFrame} frame - An Animation frame
|
||||
*
|
||||
* @param {Phaser.Animations.AnimationFrame} frame - An Animation frame.
|
||||
*/
|
||||
_updateAndGetNextTick: function (component, frame)
|
||||
updateAndGetNextTick: function (component, frame)
|
||||
{
|
||||
component.updateFrame(frame);
|
||||
|
||||
this.getNextTick(component);
|
||||
},
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ var Vec2 = require('../math/Vector2');
|
|||
* @since 3.12.0
|
||||
*
|
||||
* @param {Phaser.Game} game - A reference to the Phaser.Game instance.
|
||||
* @param {ScaleManagerConfig} config
|
||||
* @param {any} config
|
||||
*/
|
||||
var ScaleManager = new Class({
|
||||
|
||||
|
|
|
@ -348,7 +348,7 @@ var Fade = new Class({
|
|||
* @method Phaser.Cameras.Scene2D.Effects.Fade#postRenderWebGL
|
||||
* @since 3.5.0
|
||||
*
|
||||
* @param {Phaser.Renderer.WebGL.Pipelines.FlatTintPipeline} pipeline - The WebGL Pipeline to render to.
|
||||
* @param {Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline} pipeline - The WebGL Pipeline to render to.
|
||||
* @param {function} getTintFunction - A function that will return the gl safe tint colors.
|
||||
*
|
||||
* @return {boolean} `true` if the effect drew to the renderer, otherwise `false`.
|
||||
|
|
|
@ -295,7 +295,7 @@ var Flash = new Class({
|
|||
* @method Phaser.Cameras.Scene2D.Effects.Flash#postRenderWebGL
|
||||
* @since 3.5.0
|
||||
*
|
||||
* @param {Phaser.Renderer.WebGL.Pipelines.FlatTintPipeline} pipeline - The WebGL Pipeline to render to.
|
||||
* @param {Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline} pipeline - The WebGL Pipeline to render to.
|
||||
* @param {function} getTintFunction - A function that will return the gl safe tint colors.
|
||||
*
|
||||
* @return {boolean} `true` if the effect drew to the renderer, otherwise `false`.
|
||||
|
|
|
@ -131,7 +131,7 @@ var Curve = new Class({
|
|||
// So you can chain graphics calls
|
||||
return graphics.strokePoints(this.getPoints(pointsTotal));
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Returns a Rectangle where the position and dimensions match the bounds of this Curve.
|
||||
*
|
||||
|
|
|
@ -113,16 +113,6 @@ var Scene = new Class({
|
|||
*/
|
||||
this.cameras;
|
||||
|
||||
/**
|
||||
* A scene level 3D Camera System.
|
||||
* This property will only be available if defined in the Scene Injection Map.
|
||||
*
|
||||
* @name Phaser.Scene#cameras3d
|
||||
* @type {Phaser.Cameras.Sprite3D.CameraManager}
|
||||
* @since 3.0.0
|
||||
*/
|
||||
this.cameras3d;
|
||||
|
||||
/**
|
||||
* A scene level Game Object Factory.
|
||||
* This property will only be available if defined in the Scene Injection Map.
|
||||
|
|
Loading…
Reference in a new issue