mirror of
https://github.com/wassname/phaser.git
synced 2026-09-11 12:31:29 +08:00
Updated documentation.
This commit is contained in:
+116
-28
@@ -54,6 +54,10 @@
|
||||
<a href="Phaser.AnimationParser.html">AnimationParser</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.BitmapData.html">BitmapData</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.BitmapText.html">BitmapText</a>
|
||||
</li>
|
||||
@@ -138,6 +142,10 @@
|
||||
<a href="Phaser.Events.html">Events</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.Filter.html">Filter</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.Frame.html">Frame</a>
|
||||
</li>
|
||||
@@ -302,6 +310,26 @@
|
||||
<a href="Phaser.Text.html">Text</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.Tile.html">Tile</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.Tilemap.html">Tilemap</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.TilemapLayer.html">TilemapLayer</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.TilemapParser.html">TilemapParser</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.Tileset.html">Tileset</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.TileSprite.html">TileSprite</a>
|
||||
</li>
|
||||
@@ -310,6 +338,10 @@
|
||||
<a href="Phaser.Time.html">Time</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.Timer.html">Timer</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.Touch.html">Touch</a>
|
||||
</li>
|
||||
@@ -356,6 +388,14 @@
|
||||
<a href="global.html#HEXtoRGB">HEXtoRGB</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="global.html#render">render</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="global.html#renderXY">renderXY</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="global.html#right">right</a>
|
||||
</li>
|
||||
@@ -398,70 +438,102 @@
|
||||
Phaser.Touch = function (game) {
|
||||
|
||||
/**
|
||||
* @property {Phaser.Game} game - Local reference to game.
|
||||
* @property {Phaser.Game} game - A reference to the currently running game.
|
||||
*/
|
||||
this.game = game;
|
||||
|
||||
/**
|
||||
* You can disable all Input by setting disabled = true. While set all new input related events will be ignored.
|
||||
* @method Phaser.Touch#disabled
|
||||
* @property {boolean} disabled - You can disable all Touch events by setting disabled = true. While set all new touch events will be ignored.
|
||||
* @return {boolean}
|
||||
*/
|
||||
this.disabled = false;
|
||||
|
||||
/**
|
||||
* @property {Phaser.Game} callbackContext - Description.
|
||||
* @property {Object} callbackContext - The context under which callbacks are called.
|
||||
*/
|
||||
this.callbackContext = this.game;
|
||||
|
||||
/**
|
||||
* @property {Phaser.Game} touchStartCallback - Description.
|
||||
* @default
|
||||
* @property {function} touchStartCallback - A callback that can be fired on a touchStart event.
|
||||
*/
|
||||
this.touchStartCallback = null;
|
||||
|
||||
/**
|
||||
* @property {Phaser.Game} touchMoveCallback - Description.
|
||||
* @default
|
||||
* @property {function} touchMoveCallback - A callback that can be fired on a touchMove event.
|
||||
*/
|
||||
this.touchMoveCallback = null;
|
||||
|
||||
/**
|
||||
* @property {Phaser.Game} touchEndCallback - Description.
|
||||
* @default
|
||||
* @property {function} touchEndCallback - A callback that can be fired on a touchEnd event.
|
||||
*/
|
||||
this.touchEndCallback = null;
|
||||
|
||||
/**
|
||||
* @property {Phaser.Game} touchEnterCallback - Description.
|
||||
* @default
|
||||
* @property {function} touchEnterCallback - A callback that can be fired on a touchEnter event.
|
||||
*/
|
||||
this.touchEnterCallback = null;
|
||||
|
||||
/**
|
||||
* @property {Phaser.Game} touchLeaveCallback - Description.
|
||||
* @default
|
||||
* @property {function} touchLeaveCallback - A callback that can be fired on a touchLeave event.
|
||||
*/
|
||||
this.touchLeaveCallback = null;
|
||||
|
||||
/**
|
||||
* @property {Description} touchCancelCallback - Description.
|
||||
* @default
|
||||
* @property {function} touchCancelCallback - A callback that can be fired on a touchCancel event.
|
||||
*/
|
||||
this.touchCancelCallback = null;
|
||||
|
||||
/**
|
||||
* @property {boolean} preventDefault - Description.
|
||||
* @property {boolean} preventDefault - If true the TouchEvent will have prevent.default called on it.
|
||||
* @default
|
||||
*/
|
||||
this.preventDefault = true;
|
||||
|
||||
/**
|
||||
* @property {TouchEvent} event - The browser touch event.
|
||||
*/
|
||||
this.event = null;
|
||||
|
||||
/**
|
||||
* @property {function} _onTouchStart - Internal event handler reference.
|
||||
* @private
|
||||
*/
|
||||
this._onTouchStart = null;
|
||||
|
||||
/**
|
||||
* @property {function} _onTouchMove - Internal event handler reference.
|
||||
* @private
|
||||
*/
|
||||
this._onTouchMove = null;
|
||||
|
||||
/**
|
||||
* @property {function} _onTouchEnd - Internal event handler reference.
|
||||
* @private
|
||||
*/
|
||||
this._onTouchEnd = null;
|
||||
|
||||
/**
|
||||
* @property {function} _onTouchEnter - Internal event handler reference.
|
||||
* @private
|
||||
*/
|
||||
this._onTouchEnter = null;
|
||||
|
||||
/**
|
||||
* @property {function} _onTouchLeave - Internal event handler reference.
|
||||
* @private
|
||||
*/
|
||||
this._onTouchLeave = null;
|
||||
|
||||
/**
|
||||
* @property {function} _onTouchCancel - Internal event handler reference.
|
||||
* @private
|
||||
*/
|
||||
this._onTouchCancel = null;
|
||||
|
||||
/**
|
||||
* @property {function} _onTouchMove - Internal event handler reference.
|
||||
* @private
|
||||
*/
|
||||
this._onTouchMove = null;
|
||||
|
||||
};
|
||||
@@ -527,12 +599,14 @@ Phaser.Touch.prototype = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Description.
|
||||
* The internal method that handles the touchstart event from the browser.
|
||||
* @method Phaser.Touch#onTouchStart
|
||||
* @param {Any} event
|
||||
* @param {TouchEvent} event - The native event from the browser. This gets stored in Touch.event.
|
||||
*/
|
||||
onTouchStart: function (event) {
|
||||
|
||||
this.event = event;
|
||||
|
||||
if (this.touchStartCallback)
|
||||
{
|
||||
this.touchStartCallback.call(this.callbackContext, event);
|
||||
@@ -562,10 +636,12 @@ Phaser.Touch.prototype = {
|
||||
* Touch cancel - touches that were disrupted (perhaps by moving into a plugin or browser chrome).
|
||||
* Occurs for example on iOS when you put down 4 fingers and the app selector UI appears.
|
||||
* @method Phaser.Touch#onTouchCancel
|
||||
* @param {Any} event
|
||||
* @param {TouchEvent} event - The native event from the browser. This gets stored in Touch.event.
|
||||
*/
|
||||
onTouchCancel: function (event) {
|
||||
|
||||
this.event = event;
|
||||
|
||||
if (this.touchCancelCallback)
|
||||
{
|
||||
this.touchCancelCallback.call(this.callbackContext, event);
|
||||
@@ -594,10 +670,12 @@ Phaser.Touch.prototype = {
|
||||
* For touch enter and leave its a list of the touch points that have entered or left the target.
|
||||
* Doesn't appear to be supported by most browsers on a canvas element yet.
|
||||
* @method Phaser.Touch#onTouchEnter
|
||||
* @param {Any} event
|
||||
* @param {TouchEvent} event - The native event from the browser. This gets stored in Touch.event.
|
||||
*/
|
||||
onTouchEnter: function (event) {
|
||||
|
||||
this.event = event;
|
||||
|
||||
if (this.touchEnterCallback)
|
||||
{
|
||||
this.touchEnterCallback.call(this.callbackContext, event);
|
||||
@@ -613,10 +691,12 @@ Phaser.Touch.prototype = {
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
/*
|
||||
for (var i = 0; i < event.changedTouches.length; i++)
|
||||
{
|
||||
//console.log('touch enter');
|
||||
}
|
||||
*/
|
||||
|
||||
},
|
||||
|
||||
@@ -624,10 +704,12 @@ Phaser.Touch.prototype = {
|
||||
* For touch enter and leave its a list of the touch points that have entered or left the target.
|
||||
* Doesn't appear to be supported by most browsers on a canvas element yet.
|
||||
* @method Phaser.Touch#onTouchLeave
|
||||
* @param {Any} event
|
||||
*/
|
||||
* @param {TouchEvent} event - The native event from the browser. This gets stored in Touch.event.
|
||||
*/
|
||||
onTouchLeave: function (event) {
|
||||
|
||||
this.event = event;
|
||||
|
||||
if (this.touchLeaveCallback)
|
||||
{
|
||||
this.touchLeaveCallback.call(this.callbackContext, event);
|
||||
@@ -638,20 +720,24 @@ Phaser.Touch.prototype = {
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
/*
|
||||
for (var i = 0; i < event.changedTouches.length; i++)
|
||||
{
|
||||
//console.log('touch leave');
|
||||
}
|
||||
*/
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Description.
|
||||
* The handler for the touchmove events.
|
||||
* @method Phaser.Touch#onTouchMove
|
||||
* @param {Any} event
|
||||
* @param {TouchEvent} event - The native event from the browser. This gets stored in Touch.event.
|
||||
*/
|
||||
onTouchMove: function (event) {
|
||||
|
||||
this.event = event;
|
||||
|
||||
if (this.touchMoveCallback)
|
||||
{
|
||||
this.touchMoveCallback.call(this.callbackContext, event);
|
||||
@@ -670,12 +756,14 @@ Phaser.Touch.prototype = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Description.
|
||||
* The handler for the touchend events.
|
||||
* @method Phaser.Touch#onTouchEnd
|
||||
* @param {Any} event
|
||||
* @param {TouchEvent} event - The native event from the browser. This gets stored in Touch.event.
|
||||
*/
|
||||
onTouchEnd: function (event) {
|
||||
|
||||
this.event = event;
|
||||
|
||||
if (this.touchEndCallback)
|
||||
{
|
||||
this.touchEndCallback.call(this.callbackContext, event);
|
||||
@@ -735,7 +823,7 @@ Phaser.Touch.prototype = {
|
||||
|
||||
<span class="jsdoc-message">
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
|
||||
on Thu Nov 07 2013 06:07:33 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
on Thu Nov 28 2013 15:56:25 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
</span>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user