Added more jsdocs

This commit is contained in:
Richard Davey 2018-09-13 08:09:44 +01:00
parent 1ac48afd5f
commit 5fe6dbbe0c
12 changed files with 54 additions and 28 deletions

View file

@ -447,40 +447,48 @@ var Game = new Class({
/**
* Game Pre-Step event.
*
* Listen for it using the event type `prestep`.
*
* This event is dispatched before the main Step starts.
* By this point none of the Scene updates have happened.
* Hook into it from plugins or systems that need to update before the Scene Manager does.
*
* @event Phaser.Game#prestepEvent
* @param {number} time - [description]
* @param {number} delta - [description]
* @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.
* @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.
*/
/**
* Game Step event.
*
* Listen for it using the event type `step`.
*
* This event is dispatched after Pre-Step and before the Scene Manager steps.
* Hook into it from plugins or systems that need to update before the Scene Manager does, but after core Systems.
*
* @event Phaser.Game#stepEvent
* @param {number} time - [description]
* @param {number} delta - [description]
* @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.
* @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.
*/
/**
* Game Post-Step event.
*
* Listen for it using the event type `poststep`.
*
* This event is dispatched after the Scene Manager has updated.
* Hook into it from plugins or systems that need to do things before the render starts.
*
* @event Phaser.Game#poststepEvent
* @param {number} time - [description]
* @param {number} delta - [description]
* @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.
* @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.
*/
/**
* Game Pre-Render event.
*
* Listen for it using the event type `prerender`.
*
* This event is dispatched immediately before any of the Scenes have started to render.
* The renderer will already have been initialized this frame, clearing itself and preparing to receive
@ -492,6 +500,8 @@ var Game = new Class({
/**
* Game Post-Render event.
*
* Listen for it using the event type `postrender`.
*
* This event is dispatched right at the end of the render process.
* Every Scene will have rendered and drawn to the canvas.
@ -516,8 +526,8 @@ var Game = new Class({
* @fires Phaser.Game#postrenderEvent
* @since 3.0.0
*
* @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout.
* @param {number} delta - The delta time, in ms, elapsed since the last frame.
* @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.
* @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.
*/
step: function (time, delta)
{
@ -580,8 +590,8 @@ var Game = new Class({
* @fires Phaser.Game#postrenderEvent
* @since 3.2.0
*
* @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout.
* @param {number} delta - The delta time elapsed since the last frame.
* @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.
* @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.
*/
headlessStep: function (time, delta)
{
@ -608,6 +618,8 @@ var Game = new Class({
/**
* Game Pause event.
*
* Listen for it using the event type `pause`.
*
* This event is dispatched when the game loop enters a paused state, usually as a result of the Visibility Handler.
*
@ -632,6 +644,8 @@ var Game = new Class({
/**
* Game Resume event.
*
* Listen for it using the event type `resume`.
*
* This event is dispatched when the game loop leaves a paused state and resumes running.
*
@ -686,6 +700,8 @@ var Game = new Class({
/**
* Game Resize event.
*
* Listen for it using the event type `resize`.
*
* @event Phaser.Game#resizeEvent
* @param {number} width - The new width of the Game.
@ -697,6 +713,7 @@ var Game = new Class({
* Then resizes the Renderer and Input Manager scale.
*
* @method Phaser.Game#resize
* @fires Phaser.Game#reiszeEvent
* @since 3.2.0
*
* @param {number} width - The new width of the game.
@ -725,6 +742,14 @@ var Game = new Class({
this.events.emit('resize', width, height);
},
/**
* Game Destroy event.
*
* Listen for it using the event type `destroy`.
*
* @event Phaser.Game#destroyEvent
*/
/**
* Flags this Game instance as needing to be destroyed on the next frame.
* It will wait until the current frame has completed and then call `runDestroy` internally.
@ -733,6 +758,7 @@ var Game = new Class({
* memory being held by the core Phaser plugins. If you do need to create another game instance on the same page, leave this as `false`.
*
* @method Phaser.Game#destroy
* @fires Phaser.Game#destroyEvent
* @since 3.0.0
*
* @param {boolean} removeCanvas - Set to `true` if you would like the parent canvas element removed from the DOM, or `false` to leave it in place.

View file

@ -232,7 +232,7 @@ var FixedKeyControl = new Class({
* @method Phaser.Cameras.Controls.FixedKeyControl#update
* @since 3.0.0
*
* @param {number} delta - [description]
* @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.
*/
update: function (delta)
{

View file

@ -368,7 +368,7 @@ var Body = new Class({
* @method Phaser.Physics.Impact.Body#update
* @since 3.0.0
*
* @param {number} delta - [description]
* @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.
*/
update: function (delta)
{

View file

@ -12,7 +12,7 @@ var Clamp = require('../../math/Clamp');
* @function Phaser.Physics.Impact.GetVelocity
* @since 3.0.0
*
* @param {number} delta - [description]
* @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.
* @param {number} vel - [description]
* @param {number} accel - [description]
* @param {number} friction - [description]

View file

@ -592,8 +592,8 @@ var World = new Class({
* @method Phaser.Physics.Impact.World#update
* @since 3.0.0
*
* @param {number} time - [description]
* @param {number} delta - [description]
* @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.
* @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.
*/
update: function (time, delta)
{

View file

@ -633,8 +633,8 @@ var World = new Class({
* @method Phaser.Physics.Matter.World#update
* @since 3.0.0
*
* @param {number} time - [description]
* @param {number} delta - [description]
* @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.
* @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.
*/
update: function (time, delta)
{

View file

@ -251,8 +251,8 @@ var Scene = new Class({
* @override
* @since 3.0.0
*
* @param {number} time - [description]
* @param {number} delta - [description]
* @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.
* @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.
*/
update: function ()
{

View file

@ -371,8 +371,8 @@ var ScenePlugin = new Class({
* @private
* @since 3.5.0
*
* @param {number} time - [description]
* @param {number} delta - [description]
* @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.
* @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.
*/
step: function (time, delta)
{

View file

@ -216,8 +216,8 @@ var Clock = new Class({
* @method Phaser.Time.Clock#preUpdate
* @since 3.0.0
*
* @param {number} time - [description]
* @param {number} delta - [description]
* @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.
* @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.
*/
preUpdate: function ()
{
@ -267,8 +267,8 @@ var Clock = new Class({
* @method Phaser.Time.Clock#update
* @since 3.0.0
*
* @param {number} time - [description]
* @param {number} delta - [description]
* @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.
* @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.
*/
update: function (time, delta)
{

View file

@ -666,7 +666,7 @@ var Timeline = new Class({
* @since 3.0.0
*
* @param {number} timestamp - [description]
* @param {number} delta - [description]
* @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.
*
* @return {boolean} Returns `true` if this Timeline has finished and should be removed from the Tween Manager.
*/

View file

@ -344,7 +344,7 @@ var TweenManager = new Class({
* @since 3.0.0
*
* @param {number} timestamp - [description]
* @param {number} delta - [description]
* @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.
*/
update: function (timestamp, delta)
{

View file

@ -916,7 +916,7 @@ var Tween = new Class({
* @since 3.0.0
*
* @param {number} timestamp - [description]
* @param {number} delta - [description]
* @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.
*
* @return {boolean} Returns `true` if this Tween has finished and should be removed from the Tween Manager, otherwise returns `false`.
*/