mirror of
https://github.com/wassname/phaser.git
synced 2026-07-19 11:26:26 +08:00
Updated documentation.
This commit is contained in:
+117
-74
@@ -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>
|
||||
@@ -388,14 +428,17 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a new `Button` object. A Button is a special type of Sprite that is set-up to handle Pointer events automatically. The four states a Button responds to are:
|
||||
* 'Over' - when the Pointer moves over the Button. This is also commonly known as 'hover'.
|
||||
* 'Out' - when the Pointer that was previously over the Button moves out of it.
|
||||
* 'Down' - when the Pointer is pressed down on the Button. I.e. touched on a touch enabled device or clicked with the mouse.
|
||||
* 'Up' - when the Pointer that was pressed down on the Button is released again.
|
||||
* @class Phaser.Button
|
||||
*
|
||||
* @classdesc Create a new `Button` object. A Button is a special type of Sprite that is set-up to handle Pointer events automatically. The four states a Button responds to are:
|
||||
*
|
||||
* * 'Over' - when the Pointer moves over the Button. This is also commonly known as 'hover'.
|
||||
* * 'Out' - when the Pointer that was previously over the Button moves out of it.
|
||||
* * 'Down' - when the Pointer is pressed down on the Button. I.e. touched on a touch enabled device or clicked with the mouse.
|
||||
* * 'Up' - when the Pointer that was pressed down on the Button is released again.
|
||||
*
|
||||
* You can set a unique texture frame and Sound for any of these states.
|
||||
*
|
||||
* @class Phaser.Button
|
||||
* @constructor
|
||||
*
|
||||
* @param {Phaser.Game} game Current game instance.
|
||||
@@ -416,67 +459,67 @@ Phaser.Button = function (game, x, y, key, callback, callbackContext, overFrame,
|
||||
callback = callback || null;
|
||||
callbackContext = callbackContext || this;
|
||||
|
||||
Phaser.Sprite.call(this, game, x, y, key, outFrame);
|
||||
Phaser.Sprite.call(this, game, x, y, key, outFrame);
|
||||
|
||||
/**
|
||||
* @property {number} type - The Phaser Object Type.
|
||||
*/
|
||||
/**
|
||||
* @property {number} type - The Phaser Object Type.
|
||||
*/
|
||||
this.type = Phaser.BUTTON;
|
||||
|
||||
/**
|
||||
* @property {string} _onOverFrameName - Internal variable.
|
||||
* @private
|
||||
* @default
|
||||
*/
|
||||
/**
|
||||
* @property {string} _onOverFrameName - Internal variable.
|
||||
* @private
|
||||
* @default
|
||||
*/
|
||||
this._onOverFrameName = null;
|
||||
|
||||
/**
|
||||
* @property {string} _onOutFrameName - Internal variable.
|
||||
* @private
|
||||
* @default
|
||||
*/
|
||||
/**
|
||||
* @property {string} _onOutFrameName - Internal variable.
|
||||
* @private
|
||||
* @default
|
||||
*/
|
||||
this._onOutFrameName = null;
|
||||
|
||||
/**
|
||||
* @property {string} _onDownFrameName - Internal variable.
|
||||
* @private
|
||||
* @default
|
||||
*/
|
||||
/**
|
||||
* @property {string} _onDownFrameName - Internal variable.
|
||||
* @private
|
||||
* @default
|
||||
*/
|
||||
this._onDownFrameName = null;
|
||||
|
||||
/**
|
||||
* @property {string} _onUpFrameName - Internal variable.
|
||||
* @private
|
||||
* @default
|
||||
*/
|
||||
/**
|
||||
* @property {string} _onUpFrameName - Internal variable.
|
||||
* @private
|
||||
* @default
|
||||
*/
|
||||
this._onUpFrameName = null;
|
||||
|
||||
/**
|
||||
* @property {number} _onOverFrameID - Internal variable.
|
||||
* @private
|
||||
* @default
|
||||
*/
|
||||
/**
|
||||
* @property {number} _onOverFrameID - Internal variable.
|
||||
* @private
|
||||
* @default
|
||||
*/
|
||||
this._onOverFrameID = null;
|
||||
|
||||
/**
|
||||
* @property {number} _onOutFrameID - Internal variable.
|
||||
* @private
|
||||
* @default
|
||||
*/
|
||||
/**
|
||||
* @property {number} _onOutFrameID - Internal variable.
|
||||
* @private
|
||||
* @default
|
||||
*/
|
||||
this._onOutFrameID = null;
|
||||
|
||||
/**
|
||||
* @property {number} _onDownFrameID - Internal variable.
|
||||
* @private
|
||||
* @default
|
||||
*/
|
||||
/**
|
||||
* @property {number} _onDownFrameID - Internal variable.
|
||||
* @private
|
||||
* @default
|
||||
*/
|
||||
this._onDownFrameID = null;
|
||||
|
||||
/**
|
||||
* @property {number} _onUpFrameID - Internal variable.
|
||||
* @private
|
||||
* @default
|
||||
*/
|
||||
/**
|
||||
* @property {number} _onUpFrameID - Internal variable.
|
||||
* @private
|
||||
* @default
|
||||
*/
|
||||
this._onUpFrameID = null;
|
||||
|
||||
/**
|
||||
@@ -527,25 +570,25 @@ Phaser.Button = function (game, x, y, key, callback, callbackContext, overFrame,
|
||||
*/
|
||||
this.onUpSoundMarker = '';
|
||||
|
||||
/**
|
||||
* @property {Phaser.Signal} onInputOver - The Signal (or event) dispatched when this Button is in an Over state.
|
||||
*/
|
||||
this.onInputOver = new Phaser.Signal;
|
||||
/**
|
||||
* @property {Phaser.Signal} onInputOver - The Signal (or event) dispatched when this Button is in an Over state.
|
||||
*/
|
||||
this.onInputOver = new Phaser.Signal();
|
||||
|
||||
/**
|
||||
* @property {Phaser.Signal} onInputOut - The Signal (or event) dispatched when this Button is in an Out state.
|
||||
*/
|
||||
this.onInputOut = new Phaser.Signal;
|
||||
/**
|
||||
* @property {Phaser.Signal} onInputOut - The Signal (or event) dispatched when this Button is in an Out state.
|
||||
*/
|
||||
this.onInputOut = new Phaser.Signal();
|
||||
|
||||
/**
|
||||
* @property {Phaser.Signal} onInputDown - The Signal (or event) dispatched when this Button is in an Down state.
|
||||
*/
|
||||
this.onInputDown = new Phaser.Signal;
|
||||
/**
|
||||
* @property {Phaser.Signal} onInputDown - The Signal (or event) dispatched when this Button is in an Down state.
|
||||
*/
|
||||
this.onInputDown = new Phaser.Signal();
|
||||
|
||||
/**
|
||||
* @property {Phaser.Signal} onInputUp - The Signal (or event) dispatched when this Button is in an Up state.
|
||||
*/
|
||||
this.onInputUp = new Phaser.Signal;
|
||||
/**
|
||||
* @property {Phaser.Signal} onInputUp - The Signal (or event) dispatched when this Button is in an Up state.
|
||||
*/
|
||||
this.onInputUp = new Phaser.Signal();
|
||||
|
||||
/**
|
||||
* @property {boolean} freezeFrames - When true the Button will cease to change texture frame on all events (over, out, up, down).
|
||||
@@ -620,7 +663,7 @@ Phaser.Button.prototype.setFrames = function (overFrame, outFrame, downFrame) {
|
||||
this._onOutFrameName = outFrame;
|
||||
this._onUpFrameName = outFrame;
|
||||
|
||||
if (this.input.pointerOver() == false)
|
||||
if (this.input.pointerOver() === false)
|
||||
{
|
||||
this.frameName = outFrame;
|
||||
}
|
||||
@@ -630,7 +673,7 @@ Phaser.Button.prototype.setFrames = function (overFrame, outFrame, downFrame) {
|
||||
this._onOutFrameID = outFrame;
|
||||
this._onUpFrameID = outFrame;
|
||||
|
||||
if (this.input.pointerOver() == false)
|
||||
if (this.input.pointerOver() === false)
|
||||
{
|
||||
this.frame = outFrame;
|
||||
}
|
||||
@@ -790,7 +833,7 @@ Phaser.Button.prototype.setDownSound = function (sound, marker) {
|
||||
*/
|
||||
Phaser.Button.prototype.onInputOverHandler = function (pointer) {
|
||||
|
||||
if (this.freezeFrames == false)
|
||||
if (this.freezeFrames === false)
|
||||
{
|
||||
if (this._onOverFrameName != null)
|
||||
{
|
||||
@@ -822,7 +865,7 @@ Phaser.Button.prototype.onInputOverHandler = function (pointer) {
|
||||
*/
|
||||
Phaser.Button.prototype.onInputOutHandler = function (pointer) {
|
||||
|
||||
if (this.freezeFrames == false)
|
||||
if (this.freezeFrames === false)
|
||||
{
|
||||
if (this._onOutFrameName != null)
|
||||
{
|
||||
@@ -854,7 +897,7 @@ Phaser.Button.prototype.onInputOutHandler = function (pointer) {
|
||||
*/
|
||||
Phaser.Button.prototype.onInputDownHandler = function (pointer) {
|
||||
|
||||
if (this.freezeFrames == false)
|
||||
if (this.freezeFrames === false)
|
||||
{
|
||||
if (this._onDownFrameName != null)
|
||||
{
|
||||
@@ -886,7 +929,7 @@ Phaser.Button.prototype.onInputDownHandler = function (pointer) {
|
||||
*/
|
||||
Phaser.Button.prototype.onInputUpHandler = function (pointer) {
|
||||
|
||||
if (this.freezeFrames == false)
|
||||
if (this.freezeFrames === false)
|
||||
{
|
||||
if (this._onUpFrameName != null)
|
||||
{
|
||||
@@ -903,7 +946,7 @@ Phaser.Button.prototype.onInputUpHandler = function (pointer) {
|
||||
this.onUpSound.play(this.onUpSoundMarker);
|
||||
}
|
||||
|
||||
if (this.forceOut && this.freezeFrames == false)
|
||||
if (this.forceOut && this.freezeFrames === false)
|
||||
{
|
||||
if (this._onOutFrameName != null)
|
||||
{
|
||||
@@ -942,7 +985,7 @@ Phaser.Button.prototype.onInputUpHandler = function (pointer) {
|
||||
|
||||
<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