mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 15:12:18 +00:00
ArcadePhysics.Body.hitTest(x, y) will return a boolean based on if the given world coordinate are within the Body or not.
Fixed jsdoc method tags in Body.
This commit is contained in:
parent
03b80887f2
commit
439cefd481
2 changed files with 23 additions and 8 deletions
|
@ -89,6 +89,7 @@ New Features
|
|||
* SoundManager.remove(sound) now lets you remove a sound from the SoundManager, destroying it in the process.
|
||||
* Sound.destroy will remove a sound and all local references it holds, optionally removing itself from the SoundManager as well.
|
||||
* SoundManager.removeByKey(key) will remove all sounds from the SoundManager that have a key matching the given value.
|
||||
* ArcadePhysics.Body.hitTest(x, y) will return a boolean based on if the given world coordinate are within the Body or not.
|
||||
|
||||
|
||||
Bug Fixes
|
||||
|
|
|
@ -328,7 +328,7 @@ Phaser.Physics.Arcade.Body.prototype = {
|
|||
/**
|
||||
* Internal method.
|
||||
*
|
||||
* @method Phaser.Physics.Arcade#updateBounds
|
||||
* @method Phaser.Physics.Arcade.Body#updateBounds
|
||||
* @protected
|
||||
*/
|
||||
updateBounds: function () {
|
||||
|
@ -354,7 +354,7 @@ Phaser.Physics.Arcade.Body.prototype = {
|
|||
/**
|
||||
* Internal method.
|
||||
*
|
||||
* @method Phaser.Physics.Arcade#preUpdate
|
||||
* @method Phaser.Physics.Arcade.Body#preUpdate
|
||||
* @protected
|
||||
*/
|
||||
preUpdate: function () {
|
||||
|
@ -429,7 +429,7 @@ Phaser.Physics.Arcade.Body.prototype = {
|
|||
/**
|
||||
* Internal method.
|
||||
*
|
||||
* @method Phaser.Physics.Arcade#postUpdate
|
||||
* @method Phaser.Physics.Arcade.Body#postUpdate
|
||||
* @protected
|
||||
*/
|
||||
postUpdate: function () {
|
||||
|
@ -502,7 +502,7 @@ Phaser.Physics.Arcade.Body.prototype = {
|
|||
/**
|
||||
* Removes this bodies reference to its parent sprite, freeing it up for gc.
|
||||
*
|
||||
* @method Phaser.Physics.Arcade#destroy
|
||||
* @method Phaser.Physics.Arcade.Body#destroy
|
||||
*/
|
||||
destroy: function () {
|
||||
|
||||
|
@ -513,7 +513,7 @@ Phaser.Physics.Arcade.Body.prototype = {
|
|||
/**
|
||||
* Internal method.
|
||||
*
|
||||
* @method Phaser.Physics.Arcade#checkWorldBounds
|
||||
* @method Phaser.Physics.Arcade.Body#checkWorldBounds
|
||||
* @protected
|
||||
*/
|
||||
checkWorldBounds: function () {
|
||||
|
@ -551,7 +551,7 @@ Phaser.Physics.Arcade.Body.prototype = {
|
|||
* So it could be smaller or larger than the parent Sprite. You can also control the x and y offset, which
|
||||
* is the position of the Body relative to the top-left of the Sprite.
|
||||
*
|
||||
* @method Phaser.Physics.Arcade#setSize
|
||||
* @method Phaser.Physics.Arcade.Body#setSize
|
||||
* @param {number} width - The width of the Body.
|
||||
* @param {number} height - The height of the Body.
|
||||
* @param {number} offsetX - The X offset of the Body from the Sprite position.
|
||||
|
@ -577,9 +577,9 @@ Phaser.Physics.Arcade.Body.prototype = {
|
|||
/**
|
||||
* Resets all Body values (velocity, acceleration, rotation, etc)
|
||||
*
|
||||
* @method Phaser.Physics.Arcade#reset
|
||||
* @method Phaser.Physics.Arcade.Body#reset
|
||||
* @param {number} x - The new x position of the Body.
|
||||
* @param {number} y - The new x position of the Body.
|
||||
* @param {number} y - The new y position of the Body.
|
||||
*/
|
||||
reset: function (x, y) {
|
||||
|
||||
|
@ -605,6 +605,20 @@ Phaser.Physics.Arcade.Body.prototype = {
|
|||
|
||||
},
|
||||
|
||||
/**
|
||||
* Tests if a world point lies within this Body.
|
||||
*
|
||||
* @method Phaser.Physics.Arcade.Body#hitTest
|
||||
* @param {number} x - The world x coordinate to test.
|
||||
* @param {number} y - The world y coordinate to test.
|
||||
* @return {boolean} True if the given coordinates are inside this Body, otherwise false.
|
||||
*/
|
||||
hitTest: function (x, y) {
|
||||
|
||||
return Phaser.Rectangle.contains(this, x, y);
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns true if the bottom of this Body is in contact with either the world bounds or a tile.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue