mirror of
https://github.com/wassname/phaser.git
synced 2026-08-11 11:23:06 +08:00
Updated doc files.
This commit is contained in:
+118
-66
@@ -90,6 +90,10 @@
|
||||
<a href="Phaser.Device.html">Device</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.DOMSprite.html">DOMSprite</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.Easing.html">Easing</a>
|
||||
</li>
|
||||
@@ -162,6 +166,14 @@
|
||||
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.Gamepad.html">Gamepad</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.GamepadButton.html">GamepadButton</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.Graphics.html">Graphics</a>
|
||||
</li>
|
||||
@@ -186,6 +198,10 @@
|
||||
<a href="Phaser.Keyboard.html">Keyboard</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.Line.html">Line</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.LinkedList.html">LinkedList</a>
|
||||
</li>
|
||||
@@ -278,6 +294,10 @@
|
||||
<a href="Phaser.Signal.html">Signal</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.SinglePad.html">SinglePad</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.Sound.html">Sound</a>
|
||||
</li>
|
||||
@@ -342,6 +362,10 @@
|
||||
<a href="Phaser.Timer.html">Timer</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.TimerEvent.html">TimerEvent</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.Touch.html">Touch</a>
|
||||
</li>
|
||||
@@ -374,36 +398,6 @@
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="dropdown">
|
||||
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
|
||||
class="caret"></b></a>
|
||||
|
||||
<ul class="dropdown-menu ">
|
||||
|
||||
<li>
|
||||
<a href="global.html#bottom">bottom</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<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>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -423,7 +417,7 @@
|
||||
<article>
|
||||
<pre class="sunlight-highlight-javascript linenums">/**
|
||||
* @author Richard Davey <rich@photonstorm.com>
|
||||
* @copyright 2013 Photon Storm Ltd.
|
||||
* @copyright 2014 Photon Storm Ltd.
|
||||
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
||||
*/
|
||||
|
||||
@@ -435,6 +429,7 @@
|
||||
* the world at world-based coordinates. By default a world is created the same size as your Stage.
|
||||
*
|
||||
* @class Phaser.World
|
||||
* @extends Phaser.Group
|
||||
* @constructor
|
||||
* @param {Phaser.Game} game - Reference to the current game instance.
|
||||
*/
|
||||
@@ -442,11 +437,6 @@ Phaser.World = function (game) {
|
||||
|
||||
Phaser.Group.call(this, game, null, '__world', false);
|
||||
|
||||
/**
|
||||
* @property {Phaser.Point} scale - Replaces the PIXI.Point with a slightly more flexible one.
|
||||
*/
|
||||
this.scale = new Phaser.Point(1, 1);
|
||||
|
||||
/**
|
||||
* The World has no fixed size, but it does have a bounds outside of which objects are no longer considered as being "in world" and you should use this to clean-up the display list and purge dead objects.
|
||||
* By default we set the Bounds to be from 0,0 to Game.width,Game.height. I.e. it will match the size given to the game constructor with 0,0 representing the top-left of the display.
|
||||
@@ -488,34 +478,21 @@ Phaser.World.prototype.boot = function () {
|
||||
}
|
||||
|
||||
/**
|
||||
* This is called automatically every frame, and is where main logic happens.
|
||||
* This is called automatically after the plugins preUpdate and before the State.update.
|
||||
* Most objects have preUpdate methods and it's where initial movement, drawing and calculations are done.
|
||||
*
|
||||
* @method Phaser.World#update
|
||||
*/
|
||||
Phaser.World.prototype.update = function () {
|
||||
|
||||
this.currentRenderOrderID = 0;
|
||||
Phaser.World.prototype.preUpdate = function () {
|
||||
|
||||
if (this.game.stage._stage.first._iNext)
|
||||
{
|
||||
var currentNode = this.game.stage._stage.first._iNext;
|
||||
var skipChildren;
|
||||
|
||||
do
|
||||
{
|
||||
skipChildren = false;
|
||||
|
||||
if (currentNode['preUpdate'])
|
||||
{
|
||||
skipChildren = (currentNode.preUpdate() === false);
|
||||
}
|
||||
|
||||
if (currentNode['update'])
|
||||
{
|
||||
skipChildren = (currentNode.update() === false) || skipChildren;
|
||||
}
|
||||
|
||||
if (skipChildren)
|
||||
// If preUpdate exists, and it returns false, skip PIXI child objects
|
||||
if (currentNode['preUpdate'] && !currentNode.preUpdate())
|
||||
{
|
||||
currentNode = currentNode.last._iNext;
|
||||
}
|
||||
@@ -531,48 +508,123 @@ Phaser.World.prototype.update = function () {
|
||||
}
|
||||
|
||||
/**
|
||||
* This is called automatically every frame, and is where main logic happens.
|
||||
* @method Phaser.World#postUpdate
|
||||
* This is called automatically after the State.update, but before particles or plugins update.
|
||||
* Most objects won't have an update method set unless explicitly given one.
|
||||
*
|
||||
* @method Phaser.World#update
|
||||
*/
|
||||
Phaser.World.prototype.postUpdate = function () {
|
||||
Phaser.World.prototype.update = function () {
|
||||
|
||||
this.currentRenderOrderID = 0;
|
||||
|
||||
if (this.game.stage._stage.first._iNext)
|
||||
{
|
||||
var currentNode = this.game.stage._stage.first._iNext;
|
||||
|
||||
do
|
||||
{
|
||||
if (currentNode['postUpdate'])
|
||||
// If update exists, and it returns false, skip PIXI child objects
|
||||
if (currentNode['update'] && !currentNode.update())
|
||||
{
|
||||
currentNode.postUpdate();
|
||||
currentNode = currentNode.last._iNext;
|
||||
}
|
||||
else
|
||||
{
|
||||
currentNode = currentNode._iNext;
|
||||
}
|
||||
|
||||
currentNode = currentNode._iNext;
|
||||
}
|
||||
while (currentNode != this.game.stage._stage.last._iNext)
|
||||
}
|
||||
|
||||
this.camera.update();
|
||||
}
|
||||
|
||||
/**
|
||||
* This is called automatically before the renderer runs and after the plugins have updated.
|
||||
* In postUpdate this is where all the final physics calculatations and object positioning happens.
|
||||
* The objects are processed in the order of the display list.
|
||||
* The only exception to this is if the camera is following an object, in which case that is updated first.
|
||||
*
|
||||
* @method Phaser.World#postUpdate
|
||||
*/
|
||||
Phaser.World.prototype.postUpdate = function () {
|
||||
|
||||
if (this.camera.target && this.camera.target['postUpdate'])
|
||||
{
|
||||
this.camera.target.postUpdate();
|
||||
|
||||
this.camera.update();
|
||||
|
||||
if (this.game.stage._stage.first._iNext)
|
||||
{
|
||||
var currentNode = this.game.stage._stage.first._iNext;
|
||||
|
||||
do
|
||||
{
|
||||
if (currentNode['postUpdate'] && currentNode !== this.camera.target)
|
||||
{
|
||||
currentNode.postUpdate();
|
||||
}
|
||||
|
||||
currentNode = currentNode._iNext;
|
||||
}
|
||||
while (currentNode != this.game.stage._stage.last._iNext)
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.camera.update();
|
||||
|
||||
if (this.game.stage._stage.first._iNext)
|
||||
{
|
||||
var currentNode = this.game.stage._stage.first._iNext;
|
||||
|
||||
do
|
||||
{
|
||||
if (currentNode['postUpdate'])
|
||||
{
|
||||
currentNode.postUpdate();
|
||||
}
|
||||
|
||||
currentNode = currentNode._iNext;
|
||||
}
|
||||
while (currentNode != this.game.stage._stage.last._iNext)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the size of this world. Note that this doesn't modify the world x/y coordinates, just the width and height.
|
||||
* If you need to adjust the bounds of the world
|
||||
*
|
||||
* @method Phaser.World#setBounds
|
||||
* @param {number} x - Top left most corner of the world.
|
||||
* @param {number} y - Top left most corner of the world.
|
||||
* @param {number} width - New width of the world.
|
||||
* @param {number} height - New height of the world.
|
||||
* @param {number} width - New width of the world. Can never be smaller than the Game.width.
|
||||
* @param {number} height - New height of the world. Can never be smaller than the Game.height.
|
||||
*/
|
||||
Phaser.World.prototype.setBounds = function (x, y, width, height) {
|
||||
|
||||
if (width < this.game.width)
|
||||
{
|
||||
width = this.game.width;
|
||||
}
|
||||
|
||||
if (height < this.game.height)
|
||||
{
|
||||
height = this.game.height;
|
||||
}
|
||||
|
||||
this.bounds.setTo(x, y, width, height);
|
||||
|
||||
if (this.camera.bounds)
|
||||
{
|
||||
// The Camera can never be smaller than the game size
|
||||
this.camera.bounds.setTo(x, y, width, height);
|
||||
}
|
||||
|
||||
this.game.physics.setBoundsToWorld();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -722,13 +774,13 @@ Object.defineProperty(Phaser.World.prototype, "visible", {
|
||||
|
||||
|
||||
<span class="copyright">
|
||||
Phaser Copyright © 2012-2013 Photon Storm Ltd.
|
||||
Phaser Copyright © 2012-2014 Photon Storm Ltd.
|
||||
</span>
|
||||
<br />
|
||||
|
||||
<span class="jsdoc-message">
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
|
||||
on Thu Nov 28 2013 15:56:25 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
on Wed Feb 05 2014 06:28:24 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