mirror of
https://github.com/wassname/phaser.git
synced 2026-07-16 01:20:13 +08:00
More docs and quick patch to stop the body.allowRotation messing things up.
This commit is contained in:
+6
-6
@@ -93,7 +93,7 @@ Phaser.Camera.prototype = {
|
||||
/**
|
||||
* Tells this camera which sprite to follow.
|
||||
* @method follow
|
||||
* @memberOf Phaser.Camera
|
||||
* @memberof Phaser.Camera
|
||||
* @param {Phaser.Sprite} target - The object you want the camera to track. Set to null to not follow anything.
|
||||
* @param {number} [style] Leverage one of the existing "deadzone" presets. If you use a custom deadzone, ignore this parameter and manually specify the deadzone after calling follow().
|
||||
*/
|
||||
@@ -134,7 +134,7 @@ Phaser.Camera.prototype = {
|
||||
/**
|
||||
* Move the camera focus to a location instantly.
|
||||
* @method focusOnXY
|
||||
* @memberOf Phaser.Camera
|
||||
* @memberof Phaser.Camera
|
||||
* @param {number} x - X position.
|
||||
* @param {number} y - Y position.
|
||||
*/
|
||||
@@ -148,7 +148,7 @@ Phaser.Camera.prototype = {
|
||||
/**
|
||||
* Update focusing and scrolling.
|
||||
* @method update
|
||||
* @memberOf Phaser.Camera
|
||||
* @memberof Phaser.Camera
|
||||
*/
|
||||
update: function () {
|
||||
|
||||
@@ -199,7 +199,7 @@ Phaser.Camera.prototype = {
|
||||
/**
|
||||
* Method called to ensure the camera doesn't venture outside of the game world.
|
||||
* @method checkWorldBounds
|
||||
* @memberOf Phaser.Camera
|
||||
* @memberof Phaser.Camera
|
||||
*/
|
||||
checkWorldBounds: function () {
|
||||
|
||||
@@ -240,7 +240,7 @@ Phaser.Camera.prototype = {
|
||||
* without having to use game.camera.x and game.camera.y.
|
||||
*
|
||||
* @method setPosition
|
||||
* @memberOf Phaser.Camera
|
||||
* @memberof Phaser.Camera
|
||||
* @param {number} x - X position.
|
||||
* @param {number} y - Y position.
|
||||
*/
|
||||
@@ -256,7 +256,7 @@ Phaser.Camera.prototype = {
|
||||
* Sets the size of the view rectangle given the width and height in parameters.
|
||||
*
|
||||
* @method setSize
|
||||
* @memberOf Phaser.Camera
|
||||
* @memberof Phaser.Camera
|
||||
* @param {number} width - The desired width.
|
||||
* @param {number} height - The desired height.
|
||||
*/
|
||||
|
||||
+5
-5
@@ -253,7 +253,7 @@ Phaser.Game.prototype = {
|
||||
* Initialize engine sub modules and start the game.
|
||||
*
|
||||
* @method boot
|
||||
* @memberOf Phaser.Game
|
||||
* @memberof Phaser.Game
|
||||
*/
|
||||
boot: function () {
|
||||
|
||||
@@ -334,7 +334,7 @@ Phaser.Game.prototype = {
|
||||
* Checks if the device is capable of using the requested renderer and sets it up or an alternative if not.
|
||||
*
|
||||
* @method setUpRenderer
|
||||
* @memberOf Phaser.Game
|
||||
* @memberof Phaser.Game
|
||||
*/
|
||||
setUpRenderer: function () {
|
||||
|
||||
@@ -371,7 +371,7 @@ Phaser.Game.prototype = {
|
||||
* Called when the load has finished, after preload was run.
|
||||
*
|
||||
* @method loadComplete
|
||||
* @memberOf Phaser.Game
|
||||
* @memberof Phaser.Game
|
||||
*/
|
||||
loadComplete: function () {
|
||||
|
||||
@@ -385,7 +385,7 @@ Phaser.Game.prototype = {
|
||||
* The core game loop.
|
||||
*
|
||||
* @method update
|
||||
* @memberOf Phaser.Game
|
||||
* @memberof Phaser.Game
|
||||
* @param {number} time - The current time as provided by RequestAnimationFrame.
|
||||
*/
|
||||
update: function (time) {
|
||||
@@ -420,7 +420,7 @@ Phaser.Game.prototype = {
|
||||
* Nuke the entire game from orbit
|
||||
*
|
||||
* @method destroy
|
||||
* @memberOf Phaser.Game
|
||||
* @memberof Phaser.Game
|
||||
*/
|
||||
destroy: function () {
|
||||
|
||||
|
||||
+30
-30
@@ -86,7 +86,7 @@ Phaser.Group.prototype = {
|
||||
* Description.
|
||||
*
|
||||
* @method add
|
||||
* @memberOf Phaser.Group
|
||||
* @memberof Phaser.Group
|
||||
* @param {Description} child - Description.
|
||||
* @return {Description} Description.
|
||||
*/
|
||||
@@ -112,7 +112,7 @@ Phaser.Group.prototype = {
|
||||
* Description.
|
||||
*
|
||||
* @method addAt
|
||||
* @memberOf Phaser.Group
|
||||
* @memberof Phaser.Group
|
||||
* @param {Description} child - Description.
|
||||
* @param {Description} index - Description.
|
||||
* @return {Description} Description.
|
||||
@@ -139,7 +139,7 @@ Phaser.Group.prototype = {
|
||||
* Description.
|
||||
*
|
||||
* @method getAt
|
||||
* @memberOf Phaser.Group
|
||||
* @memberof Phaser.Group
|
||||
* @param {Description} index - Description.
|
||||
* @return {Description} Description.
|
||||
*/
|
||||
@@ -153,7 +153,7 @@ Phaser.Group.prototype = {
|
||||
* Description.
|
||||
*
|
||||
* @method create
|
||||
* @memberOf Phaser.Group
|
||||
* @memberof Phaser.Group
|
||||
* @param {number} x - Description.
|
||||
* @param {number} y - Description.
|
||||
* @param {string} key - Description.
|
||||
@@ -185,7 +185,7 @@ Phaser.Group.prototype = {
|
||||
* Description.
|
||||
*
|
||||
* @method swap
|
||||
* @memberOf Phaser.Group
|
||||
* @memberof Phaser.Group
|
||||
* @param {Description} child1 - Description.
|
||||
* @param {Description} child2 - Description.
|
||||
* @return {boolean} Description.
|
||||
@@ -314,7 +314,7 @@ Phaser.Group.prototype = {
|
||||
* Description.
|
||||
*
|
||||
* @method bringToTop
|
||||
* @memberOf Phaser.Group
|
||||
* @memberof Phaser.Group
|
||||
* @param {Description} child - Description.
|
||||
* @return {Description} Description.
|
||||
*/
|
||||
@@ -334,7 +334,7 @@ Phaser.Group.prototype = {
|
||||
* Description.
|
||||
*
|
||||
* @method getIndex
|
||||
* @memberOf Phaser.Group
|
||||
* @memberof Phaser.Group
|
||||
* @param {Description} child - Description.
|
||||
* @return {Description} Description.
|
||||
*/
|
||||
@@ -348,7 +348,7 @@ Phaser.Group.prototype = {
|
||||
* Description.
|
||||
*
|
||||
* @method replace
|
||||
* @memberOf Phaser.Group
|
||||
* @memberof Phaser.Group
|
||||
* @param {Description} oldChild - Description.
|
||||
* @param {Description} newChild - Description.
|
||||
*/
|
||||
@@ -380,7 +380,7 @@ Phaser.Group.prototype = {
|
||||
* Description.
|
||||
*
|
||||
* @method setProperty
|
||||
* @memberOf Phaser.Group
|
||||
* @memberof Phaser.Group
|
||||
* @param {Description} child - Description.
|
||||
* @param {array} key - An array of values that will be set.
|
||||
* @param {Description} value - Description.
|
||||
@@ -444,7 +444,7 @@ Phaser.Group.prototype = {
|
||||
* Description.
|
||||
*
|
||||
* @method setAll
|
||||
* @memberOf Phaser.Group
|
||||
* @memberof Phaser.Group
|
||||
* @param {Description} key - Description.
|
||||
* @param {Description} value - Description.
|
||||
* @param {Description} checkAlive - Description.
|
||||
@@ -483,7 +483,7 @@ Phaser.Group.prototype = {
|
||||
* Group.addAll('x', 10) will add 10 to the child.x value.
|
||||
*
|
||||
* @method addAll
|
||||
* @memberOf Phaser.Group
|
||||
* @memberof Phaser.Group
|
||||
* @param {string} property - The property to increment, for example 'body.velocity.x' or 'angle'.
|
||||
* @param {number} amount - The amount to increment the property by. If child.x = 10 then addAll('x', 40) would make child.x = 50.
|
||||
* @param {boolean} checkAlive - If true the property will only be changed if the child is alive.
|
||||
@@ -500,7 +500,7 @@ Phaser.Group.prototype = {
|
||||
* Group.subAll('x', 10) will minus 10 from the child.x value.
|
||||
*
|
||||
* @method subAll
|
||||
* @memberOf Phaser.Group
|
||||
* @memberof Phaser.Group
|
||||
* @param {string} property - The property to decrement, for example 'body.velocity.x' or 'angle'.
|
||||
* @param {number} amount - The amount to subtract from the property. If child.x = 50 then subAll('x', 40) would make child.x = 10.
|
||||
* @param {boolean} checkAlive - If true the property will only be changed if the child is alive.
|
||||
@@ -517,7 +517,7 @@ Phaser.Group.prototype = {
|
||||
* Group.multiplyAll('x', 2) will x2 the child.x value.
|
||||
*
|
||||
* @method multiplyAll
|
||||
* @memberOf Phaser.Group
|
||||
* @memberof Phaser.Group
|
||||
* @param {string} property - The property to multiply, for example 'body.velocity.x' or 'angle'.
|
||||
* @param {number} amount - The amount to multiply the property by. If child.x = 10 then multiplyAll('x', 2) would make child.x = 20.
|
||||
* @param {boolean} checkAlive - If true the property will only be changed if the child is alive.
|
||||
@@ -534,7 +534,7 @@ Phaser.Group.prototype = {
|
||||
* Group.divideAll('x', 2) will half the child.x value.
|
||||
*
|
||||
* @method divideAll
|
||||
* @memberOf Phaser.Group
|
||||
* @memberof Phaser.Group
|
||||
* @param {string} property - The property to divide, for example 'body.velocity.x' or 'angle'.
|
||||
* @param {number} amount - The amount to divide the property by. If child.x = 100 then divideAll('x', 2) would make child.x = 50.
|
||||
* @param {boolean} checkAlive - If true the property will only be changed if the child is alive.
|
||||
@@ -551,7 +551,7 @@ Phaser.Group.prototype = {
|
||||
* After the existsValue parameter you can add as many parameters as you like, which will all be passed to the child callback.
|
||||
*
|
||||
* @method callAllExists
|
||||
* @memberOf Phaser.Group
|
||||
* @memberof Phaser.Group
|
||||
* @param {function} callback - The function that exists on the children that will be called.
|
||||
* @param {boolean} existsValue - Only children with exists=existsValue will be called.
|
||||
* @param {...*} parameter - Additional parameters that will be passed to the callback.
|
||||
@@ -584,7 +584,7 @@ Phaser.Group.prototype = {
|
||||
* After the callback parameter you can add as many extra parameters as you like, which will all be passed to the child.
|
||||
*
|
||||
* @method callAll
|
||||
* @memberOf Phaser.Group
|
||||
* @memberof Phaser.Group
|
||||
* @param {function} callback - The function that exists on the children that will be called.
|
||||
* @param {...*} parameter - Additional parameters that will be passed to the callback.
|
||||
*/
|
||||
@@ -616,7 +616,7 @@ Phaser.Group.prototype = {
|
||||
* After the checkExists parameter you can add as many parameters as you like, which will all be passed to the callback along with the child.
|
||||
*
|
||||
* @method forEach
|
||||
* @memberOf Phaser.Group
|
||||
* @memberof Phaser.Group
|
||||
* @param {Description} callback - Description.
|
||||
* @param {Description} callbackContext - Description.
|
||||
* @param {boolean} checkExists - Description.
|
||||
@@ -655,7 +655,7 @@ Phaser.Group.prototype = {
|
||||
* Description.
|
||||
*
|
||||
* @method forEachAlive
|
||||
* @memberOf Phaser.Group
|
||||
* @memberof Phaser.Group
|
||||
* @param {Description} callback - Description.
|
||||
* @param {Description} callbackContext - Description.
|
||||
*/
|
||||
@@ -688,7 +688,7 @@ Phaser.Group.prototype = {
|
||||
* Description.
|
||||
*
|
||||
* @method forEachDead
|
||||
* @memberOf Phaser.Group
|
||||
* @memberof Phaser.Group
|
||||
* @param {Description} callback - Description.
|
||||
* @param {Description} callbackContext - Description.
|
||||
*/
|
||||
@@ -720,7 +720,7 @@ Phaser.Group.prototype = {
|
||||
* Call this function to retrieve the first object with exists == (the given state) in the group.
|
||||
*
|
||||
* @method getFirstExists
|
||||
* @memberOf Phaser.Group
|
||||
* @memberof Phaser.Group
|
||||
* @param {Description} state - Description.
|
||||
* @return {Any} The first child, or null if none found.
|
||||
*/
|
||||
@@ -756,7 +756,7 @@ Phaser.Group.prototype = {
|
||||
* This is handy for checking if everything's wiped out, or choosing a squad leader, etc.
|
||||
*
|
||||
* @method getFirstAlive
|
||||
* @memberOf Phaser.Group
|
||||
* @memberof Phaser.Group
|
||||
* @return {Any} The first alive child, or null if none found.
|
||||
*/
|
||||
getFirstAlive: function () {
|
||||
@@ -786,7 +786,7 @@ Phaser.Group.prototype = {
|
||||
* This is handy for checking if everything's wiped out, or choosing a squad leader, etc.
|
||||
*
|
||||
* @method getFirstDead
|
||||
* @memberOf Phaser.Group
|
||||
* @memberof Phaser.Group
|
||||
* @return {Any} The first dead child, or null if none found.
|
||||
*/
|
||||
getFirstDead: function () {
|
||||
@@ -815,7 +815,7 @@ Phaser.Group.prototype = {
|
||||
* Call this function to find out how many members of the group are alive.
|
||||
*
|
||||
* @method countLiving
|
||||
* @memberOf Phaser.Group
|
||||
* @memberof Phaser.Group
|
||||
* @return {number} The number of children flagged as alive. Returns -1 if Group is empty.
|
||||
*/
|
||||
countLiving: function () {
|
||||
@@ -846,7 +846,7 @@ Phaser.Group.prototype = {
|
||||
* Call this function to find out how many members of the group are dead.
|
||||
*
|
||||
* @method countDead
|
||||
* @memberOf Phaser.Group
|
||||
* @memberof Phaser.Group
|
||||
* @return {number} The number of children flagged as dead. Returns -1 if Group is empty.
|
||||
*/
|
||||
countDead: function () {
|
||||
@@ -877,7 +877,7 @@ Phaser.Group.prototype = {
|
||||
* Returns a member at random from the group.
|
||||
*
|
||||
* @method getRandom
|
||||
* @memberOf Phaser.Group
|
||||
* @memberof Phaser.Group
|
||||
* @param {number} startIndex - Optional offset off the front of the array. Default value is 0, or the beginning of the array.
|
||||
* @param {number} length - Optional restriction on the number of values you want to randomly select from.
|
||||
* @return {Any} A random child of this Group.
|
||||
@@ -900,7 +900,7 @@ Phaser.Group.prototype = {
|
||||
* Description.
|
||||
*
|
||||
* @method remove
|
||||
* @memberOf Phaser.Group
|
||||
* @memberof Phaser.Group
|
||||
* @param {Description} child - Description.
|
||||
*/
|
||||
remove: function (child) {
|
||||
@@ -915,7 +915,7 @@ Phaser.Group.prototype = {
|
||||
* Description.
|
||||
*
|
||||
* @method removeAll
|
||||
* @memberOf Phaser.Group
|
||||
* @memberof Phaser.Group
|
||||
*/
|
||||
removeAll: function () {
|
||||
|
||||
@@ -940,7 +940,7 @@ Phaser.Group.prototype = {
|
||||
* Description.
|
||||
*
|
||||
* @method removeBetween
|
||||
* @memberOf Phaser.Group
|
||||
* @memberof Phaser.Group
|
||||
* @param {Description} startIndex - Description.
|
||||
* @param {Description} endIndex - Description.
|
||||
*/
|
||||
@@ -969,7 +969,7 @@ Phaser.Group.prototype = {
|
||||
* Description.
|
||||
*
|
||||
* @method destroy
|
||||
* @memberOf Phaser.Group
|
||||
* @memberof Phaser.Group
|
||||
*/
|
||||
destroy: function () {
|
||||
|
||||
@@ -989,7 +989,7 @@ Phaser.Group.prototype = {
|
||||
* Description.
|
||||
*
|
||||
* @method dump
|
||||
* @memberOf Phaser.Group
|
||||
* @memberof Phaser.Group
|
||||
*/
|
||||
dump: function (full) {
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ Phaser.SignalBinding = function (signal, listener, isOnce, listenerContext, prio
|
||||
|
||||
/**
|
||||
* @property {object|undefined|null} context - Context on which listener will be executed (object that should represent the `this` variable inside listener function).
|
||||
* @memberOf SignalBinding.prototype
|
||||
* @memberof SignalBinding.prototype
|
||||
*/
|
||||
this.context = listenerContext;
|
||||
|
||||
|
||||
@@ -171,7 +171,8 @@ Phaser.Physics.Arcade.Body.prototype = {
|
||||
|
||||
if (this.allowRotation)
|
||||
{
|
||||
this.sprite.angle = this.rotation;
|
||||
// Needs to use rotation delta
|
||||
// this.sprite.angle += this.rotation;
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user