mirror of
https://github.com/photonstorm/phaser
synced 2024-11-25 06:00:41 +00:00
Added more jsdocs
This commit is contained in:
parent
1ac48afd5f
commit
5fe6dbbe0c
12 changed files with 54 additions and 28 deletions
|
@ -447,40 +447,48 @@ var Game = new Class({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Game Pre-Step event.
|
* Game Pre-Step event.
|
||||||
|
*
|
||||||
|
* Listen for it using the event type `prestep`.
|
||||||
*
|
*
|
||||||
* This event is dispatched before the main Step starts.
|
* This event is dispatched before the main Step starts.
|
||||||
* By this point none of the Scene updates have happened.
|
* 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.
|
* Hook into it from plugins or systems that need to update before the Scene Manager does.
|
||||||
*
|
*
|
||||||
* @event Phaser.Game#prestepEvent
|
* @event Phaser.Game#prestepEvent
|
||||||
* @param {number} time - [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 - [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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Game Step event.
|
* Game Step event.
|
||||||
|
*
|
||||||
|
* Listen for it using the event type `step`.
|
||||||
*
|
*
|
||||||
* This event is dispatched after Pre-Step and before the Scene Manager steps.
|
* 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.
|
* Hook into it from plugins or systems that need to update before the Scene Manager does, but after core Systems.
|
||||||
*
|
*
|
||||||
* @event Phaser.Game#stepEvent
|
* @event Phaser.Game#stepEvent
|
||||||
* @param {number} time - [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 - [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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Game Post-Step event.
|
* Game Post-Step event.
|
||||||
|
*
|
||||||
|
* Listen for it using the event type `poststep`.
|
||||||
*
|
*
|
||||||
* This event is dispatched after the Scene Manager has updated.
|
* 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.
|
* Hook into it from plugins or systems that need to do things before the render starts.
|
||||||
*
|
*
|
||||||
* @event Phaser.Game#poststepEvent
|
* @event Phaser.Game#poststepEvent
|
||||||
* @param {number} time - [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 - [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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Game Pre-Render event.
|
* 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.
|
* 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
|
* 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.
|
* Game Post-Render event.
|
||||||
|
*
|
||||||
|
* Listen for it using the event type `postrender`.
|
||||||
*
|
*
|
||||||
* This event is dispatched right at the end of the render process.
|
* This event is dispatched right at the end of the render process.
|
||||||
* Every Scene will have rendered and drawn to the canvas.
|
* Every Scene will have rendered and drawn to the canvas.
|
||||||
|
@ -516,8 +526,8 @@ var Game = new Class({
|
||||||
* @fires Phaser.Game#postrenderEvent
|
* @fires Phaser.Game#postrenderEvent
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
*
|
*
|
||||||
* @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout.
|
* @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, elapsed since the last frame.
|
* @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)
|
step: function (time, delta)
|
||||||
{
|
{
|
||||||
|
@ -580,8 +590,8 @@ var Game = new Class({
|
||||||
* @fires Phaser.Game#postrenderEvent
|
* @fires Phaser.Game#postrenderEvent
|
||||||
* @since 3.2.0
|
* @since 3.2.0
|
||||||
*
|
*
|
||||||
* @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout.
|
* @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 elapsed since the last frame.
|
* @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)
|
headlessStep: function (time, delta)
|
||||||
{
|
{
|
||||||
|
@ -608,6 +618,8 @@ var Game = new Class({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Game Pause event.
|
* 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.
|
* 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.
|
* 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.
|
* 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.
|
* Game Resize event.
|
||||||
|
*
|
||||||
|
* Listen for it using the event type `resize`.
|
||||||
*
|
*
|
||||||
* @event Phaser.Game#resizeEvent
|
* @event Phaser.Game#resizeEvent
|
||||||
* @param {number} width - The new width of the Game.
|
* @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.
|
* Then resizes the Renderer and Input Manager scale.
|
||||||
*
|
*
|
||||||
* @method Phaser.Game#resize
|
* @method Phaser.Game#resize
|
||||||
|
* @fires Phaser.Game#reiszeEvent
|
||||||
* @since 3.2.0
|
* @since 3.2.0
|
||||||
*
|
*
|
||||||
* @param {number} width - The new width of the game.
|
* @param {number} width - The new width of the game.
|
||||||
|
@ -725,6 +742,14 @@ var Game = new Class({
|
||||||
this.events.emit('resize', width, height);
|
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.
|
* 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.
|
* 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`.
|
* 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
|
* @method Phaser.Game#destroy
|
||||||
|
* @fires Phaser.Game#destroyEvent
|
||||||
* @since 3.0.0
|
* @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.
|
* @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.
|
||||||
|
|
|
@ -232,7 +232,7 @@ var FixedKeyControl = new Class({
|
||||||
* @method Phaser.Cameras.Controls.FixedKeyControl#update
|
* @method Phaser.Cameras.Controls.FixedKeyControl#update
|
||||||
* @since 3.0.0
|
* @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)
|
update: function (delta)
|
||||||
{
|
{
|
||||||
|
|
|
@ -368,7 +368,7 @@ var Body = new Class({
|
||||||
* @method Phaser.Physics.Impact.Body#update
|
* @method Phaser.Physics.Impact.Body#update
|
||||||
* @since 3.0.0
|
* @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)
|
update: function (delta)
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,7 +12,7 @@ var Clamp = require('../../math/Clamp');
|
||||||
* @function Phaser.Physics.Impact.GetVelocity
|
* @function Phaser.Physics.Impact.GetVelocity
|
||||||
* @since 3.0.0
|
* @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} vel - [description]
|
||||||
* @param {number} accel - [description]
|
* @param {number} accel - [description]
|
||||||
* @param {number} friction - [description]
|
* @param {number} friction - [description]
|
||||||
|
|
|
@ -592,8 +592,8 @@ var World = new Class({
|
||||||
* @method Phaser.Physics.Impact.World#update
|
* @method Phaser.Physics.Impact.World#update
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
*
|
*
|
||||||
* @param {number} time - [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 - [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 (time, delta)
|
update: function (time, delta)
|
||||||
{
|
{
|
||||||
|
|
|
@ -633,8 +633,8 @@ var World = new Class({
|
||||||
* @method Phaser.Physics.Matter.World#update
|
* @method Phaser.Physics.Matter.World#update
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
*
|
*
|
||||||
* @param {number} time - [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 - [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 (time, delta)
|
update: function (time, delta)
|
||||||
{
|
{
|
||||||
|
|
|
@ -251,8 +251,8 @@ var Scene = new Class({
|
||||||
* @override
|
* @override
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
*
|
*
|
||||||
* @param {number} time - [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 - [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 ()
|
update: function ()
|
||||||
{
|
{
|
||||||
|
|
|
@ -371,8 +371,8 @@ var ScenePlugin = new Class({
|
||||||
* @private
|
* @private
|
||||||
* @since 3.5.0
|
* @since 3.5.0
|
||||||
*
|
*
|
||||||
* @param {number} time - [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 - [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.
|
||||||
*/
|
*/
|
||||||
step: function (time, delta)
|
step: function (time, delta)
|
||||||
{
|
{
|
||||||
|
|
|
@ -216,8 +216,8 @@ var Clock = new Class({
|
||||||
* @method Phaser.Time.Clock#preUpdate
|
* @method Phaser.Time.Clock#preUpdate
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
*
|
*
|
||||||
* @param {number} time - [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 - [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.
|
||||||
*/
|
*/
|
||||||
preUpdate: function ()
|
preUpdate: function ()
|
||||||
{
|
{
|
||||||
|
@ -267,8 +267,8 @@ var Clock = new Class({
|
||||||
* @method Phaser.Time.Clock#update
|
* @method Phaser.Time.Clock#update
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
*
|
*
|
||||||
* @param {number} time - [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 - [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 (time, delta)
|
update: function (time, delta)
|
||||||
{
|
{
|
||||||
|
|
|
@ -666,7 +666,7 @@ var Timeline = new Class({
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
*
|
*
|
||||||
* @param {number} timestamp - [description]
|
* @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.
|
* @return {boolean} Returns `true` if this Timeline has finished and should be removed from the Tween Manager.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -344,7 +344,7 @@ var TweenManager = new Class({
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
*
|
*
|
||||||
* @param {number} timestamp - [description]
|
* @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)
|
update: function (timestamp, delta)
|
||||||
{
|
{
|
||||||
|
|
|
@ -916,7 +916,7 @@ var Tween = new Class({
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
*
|
*
|
||||||
* @param {number} timestamp - [description]
|
* @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`.
|
* @return {boolean} Returns `true` if this Tween has finished and should be removed from the Tween Manager, otherwise returns `false`.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue