mirror of
https://github.com/photonstorm/phaser
synced 2024-11-17 02:08:40 +00:00
Add callbacks on Dom and Data
This commit is contained in:
parent
33e49a4416
commit
1e8311e1ab
3 changed files with 18 additions and 5 deletions
|
@ -6,6 +6,15 @@
|
||||||
|
|
||||||
var Class = require('../utils/Class');
|
var Class = require('../utils/Class');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @callback DataEachCallback
|
||||||
|
*
|
||||||
|
* @param {any} parent - [description]
|
||||||
|
* @param {string} key - [description]
|
||||||
|
* @param {any} value - [description]
|
||||||
|
* @param {...*} [arguments] - Additional arguments that will be passed to the callback, after the game object, key, and data.
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @classdesc
|
* @classdesc
|
||||||
* The Data Component features a means to store pieces of data specific to a Game Object, System or Plugin.
|
* The Data Component features a means to store pieces of data specific to a Game Object, System or Plugin.
|
||||||
|
@ -199,7 +208,7 @@ var DataManager = new Class({
|
||||||
* @method Phaser.Data.DataManager#each
|
* @method Phaser.Data.DataManager#each
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
*
|
*
|
||||||
* @param {function} callback - The function to call.
|
* @param {DataEachCallback} callback - The function to call.
|
||||||
* @param {object} [scope] - Value to use as `this` when executing callback.
|
* @param {object} [scope] - Value to use as `this` when executing callback.
|
||||||
* @param {...*} [arguments] - Additional arguments that will be passed to the callback, after the game object, key, and data.
|
* @param {...*} [arguments] - Additional arguments that will be passed to the callback, after the game object, key, and data.
|
||||||
*
|
*
|
||||||
|
|
|
@ -6,6 +6,10 @@
|
||||||
|
|
||||||
var OS = require('../device/OS');
|
var OS = require('../device/OS');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @callback ContentLoadedCallback
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inspects the readyState of the document. If the document is already complete then it invokes the given callback.
|
* Inspects the readyState of the document. If the document is already complete then it invokes the given callback.
|
||||||
* If not complete it sets up several event listeners such as `deviceready`, and once those fire, it invokes the callback.
|
* If not complete it sets up several event listeners such as `deviceready`, and once those fire, it invokes the callback.
|
||||||
|
@ -14,7 +18,7 @@ var OS = require('../device/OS');
|
||||||
* @function Phaser.DOM.DOMContentLoaded
|
* @function Phaser.DOM.DOMContentLoaded
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
*
|
*
|
||||||
* @param {function} callback - The callback to be invoked when the device is ready and the DOM content is loaded.
|
* @param {ContentLoadedCallback} callback - The callback to be invoked when the device is ready and the DOM content is loaded.
|
||||||
*/
|
*/
|
||||||
var DOMContentLoaded = function (callback)
|
var DOMContentLoaded = function (callback)
|
||||||
{
|
{
|
||||||
|
|
|
@ -37,7 +37,7 @@ var RequestAnimationFrame = new Class({
|
||||||
* The callback to be invoked each step.
|
* The callback to be invoked each step.
|
||||||
*
|
*
|
||||||
* @name Phaser.DOM.RequestAnimationFrame#callback
|
* @name Phaser.DOM.RequestAnimationFrame#callback
|
||||||
* @type {function}
|
* @type {FrameRequestCallback}
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
*/
|
*/
|
||||||
this.callback = NOOP;
|
this.callback = NOOP;
|
||||||
|
@ -89,7 +89,7 @@ var RequestAnimationFrame = new Class({
|
||||||
* Updates the local tick value, invokes the callback and schedules another call to requestAnimationFrame.
|
* Updates the local tick value, invokes the callback and schedules another call to requestAnimationFrame.
|
||||||
*
|
*
|
||||||
* @name Phaser.DOM.RequestAnimationFrame#step
|
* @name Phaser.DOM.RequestAnimationFrame#step
|
||||||
* @type {function}
|
* @type {FrameRequestCallback}
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
*/
|
*/
|
||||||
this.step = function step (timestamp)
|
this.step = function step (timestamp)
|
||||||
|
@ -134,7 +134,7 @@ var RequestAnimationFrame = new Class({
|
||||||
* @method Phaser.DOM.RequestAnimationFrame#start
|
* @method Phaser.DOM.RequestAnimationFrame#start
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
*
|
*
|
||||||
* @param {function} callback - The callback to invoke each step.
|
* @param {FrameRequestCallback} callback - The callback to invoke each step.
|
||||||
* @param {boolean} forceSetTimeOut - Should it use SetTimeout, even if RAF is available?
|
* @param {boolean} forceSetTimeOut - Should it use SetTimeout, even if RAF is available?
|
||||||
*/
|
*/
|
||||||
start: function (callback, forceSetTimeOut)
|
start: function (callback, forceSetTimeOut)
|
||||||
|
|
Loading…
Reference in a new issue