Add TweenBuilderConfig type

This commit is contained in:
samme 2019-05-28 11:44:43 -07:00
parent f7a374b096
commit c7af250100
4 changed files with 39 additions and 34 deletions

View file

@ -193,7 +193,7 @@ var TweenManager = new Class({
* @method Phaser.Tweens.TweenManager#create
* @since 3.0.0
*
* @param {object} config - The configuration object for the Tween as per {@link Phaser.Tweens.Builders.TweenBuilder}.
* @param {Phaser.Types.Tweens.TweenBuilderConfig} config - The configuration object for the Tween.
*
* @return {Phaser.Tweens.Tween} The created Tween object.
*/
@ -208,7 +208,7 @@ var TweenManager = new Class({
* @method Phaser.Tweens.TweenManager#add
* @since 3.0.0
*
* @param {object} config - The configuration object for the Tween as per the {@link Phaser.Tweens.Builders.TweenBuilder}.
* @param {Phaser.Types.Tweens.TweenBuilderConfig} config - The configuration object for the Tween.
*
* @return {Phaser.Tweens.Tween} The created Tween.
*/

View file

@ -17,42 +17,16 @@ var Tween = require('../tween/Tween');
var TweenData = require('../tween/TweenData');
/**
* [description]
* Creates a new Tween.
*
* @function Phaser.Tweens.Builders.TweenBuilder
* @since 3.0.0
*
* @param {(Phaser.Tweens.TweenManager|Phaser.Tweens.Timeline)} parent - [description]
* @param {object} config - [description]
* @param {(Phaser.Tweens.TweenManager|Phaser.Tweens.Timeline)} parent - The owner of the new Tween.
* @param {Phaser.Types.Tweens.TweenBuilderConfig} config - Configuration for the new Tween.
* @param {Phaser.Types.Tweens.TweenConfigDefaults} defaults - Tween configuration defaults.
`
* @property {(object|object[])} targets - The object, or an array of objects, to run the tween on.
* @property {number} [delay=0] - The number of milliseconds to delay before the tween will start.
* @property {number} [duration=1000] - The duration of the tween in milliseconds.
* @property {string} [ease='Power0'] - The easing equation to use for the tween.
* @property {array} [easeParams] - Optional easing parameters.
* @property {number} [hold=0] - The number of milliseconds to hold the tween for before yoyo'ing.
* @property {number} [repeat=0] - The number of times to repeat the tween.
* @property {number} [repeatDelay=0] - The number of milliseconds to pause before a tween will repeat.
* @property {boolean} [yoyo=false] - Should the tween complete, then reverse the values incrementally to get back to the starting tween values? The reverse tweening will also take `duration` milliseconds to complete.
* @property {boolean} [flipX=false] - Horizontally flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the `flipX` property.
* @property {boolean} [flipY=false] - Vertically flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the `flipY` property.
`
{
targets: null,
delay: 0,
duration: 1000,
ease: 'Power0',
easeParams: null,
hold: 0,
repeat: 0,
repeatDelay: 0,
yoyo: false,
flipX: false,
flipY: false
};
*
* @return {Phaser.Tweens.Tween} [description]
* @return {Phaser.Tweens.Tween} The new tween.
*/
var TweenBuilder = function (parent, config, defaults)
{

View file

@ -1423,7 +1423,7 @@ Tween.TYPES = [
* @method Phaser.GameObjects.GameObjectFactory#tween
* @since 3.0.0
*
* @param {object} config - The Tween configuration.
* @param {Phaser.Types.Tweens.TweenBuilderConfig} config - The Tween configuration.
*
* @return {Phaser.Tweens.Tween} The Tween that was created.
*/
@ -1448,7 +1448,7 @@ GameObjectFactory.register('tween', function (config)
* @method Phaser.GameObjects.GameObjectCreator#tween
* @since 3.0.0
*
* @param {object} config - The Tween configuration.
* @param {Phaser.Types.Tweens.TweenBuilderConfig} config - The Tween configuration.
*
* @return {Phaser.Tweens.Tween} The Tween that was created.
*/

View file

@ -0,0 +1,31 @@
/**
* @typedef {object} Phaser.Types.Tweens.TweenBuilderConfig
* @since 3.18.0
*
* @property {any} targets - The object, or an array of objects, to run the tween on.
* @property {number} [delay=0] - The number of milliseconds to delay before the tween will start.
* @property {number} [duration=1000] - The duration of the tween in milliseconds.
* @property {string} [ease='Power0'] - The easing equation to use for the tween.
* @property {array} [easeParams] - Optional easing parameters.
* @property {number} [hold=0] - The number of milliseconds to hold the tween for before yoyo'ing.
* @property {number} [repeat=0] - The number of times to repeat the tween.
* @property {number} [repeatDelay=0] - The number of milliseconds to pause before a tween will repeat.
* @property {boolean} [yoyo=false] - Should the tween complete, then reverse the values incrementally to get back to the starting tween values? The reverse tweening will also take `duration` milliseconds to complete.
* @property {boolean} [flipX=false] - Horizontally flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the `flipX` property.
* @property {boolean} [flipY=false] - Vertically flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the `flipY` property.
*
* @example
* {
* targets: null,
* delay: 0,
* duration: 1000,
* ease: 'Power0',
* easeParams: null,
* hold: 0,
* repeat: 0,
* repeatDelay: 0,
* yoyo: false,
* flipX: false,
* flipY: false
* };
*/