mirror of
https://github.com/photonstorm/phaser
synced 2024-11-10 07:04:31 +00:00
Merge pull request #5162 from samme/docs/arcade-physics-types
Add Arcade Physics types
This commit is contained in:
commit
54841002eb
10 changed files with 52 additions and 18 deletions
|
@ -104,7 +104,7 @@ var Factory = new Class({
|
|||
* @param {Phaser.GameObjects.GameObject} gameObject - A Game Object.
|
||||
* @param {boolean} [isStatic=false] - Create a Static body (true) or Dynamic body (false).
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} The Game Object.
|
||||
* @return {Phaser.Types.Physics.Arcade.GameObjectWithBody} The Game Object.
|
||||
*/
|
||||
existing: function (gameObject, isStatic)
|
||||
{
|
||||
|
@ -126,7 +126,7 @@ var Factory = new Class({
|
|||
* @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
|
||||
* @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.
|
||||
*
|
||||
* @return {Phaser.Physics.Arcade.Image} The Image object that was created.
|
||||
* @return {Phaser.Types.Physics.Arcade.ImageWithStaticBody} The Image object that was created.
|
||||
*/
|
||||
staticImage: function (x, y, key, frame)
|
||||
{
|
||||
|
@ -150,7 +150,7 @@ var Factory = new Class({
|
|||
* @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
|
||||
* @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.
|
||||
*
|
||||
* @return {Phaser.Physics.Arcade.Image} The Image object that was created.
|
||||
* @return {Phaser.Types.Physics.Arcade.ImageWithDynamicBody} The Image object that was created.
|
||||
*/
|
||||
image: function (x, y, key, frame)
|
||||
{
|
||||
|
@ -174,7 +174,7 @@ var Factory = new Class({
|
|||
* @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
|
||||
* @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.
|
||||
*
|
||||
* @return {Phaser.Physics.Arcade.Sprite} The Sprite object that was created.
|
||||
* @return {Phaser.Types.Physics.Arcade.SpriteWithStaticBody} The Sprite object that was created.
|
||||
*/
|
||||
staticSprite: function (x, y, key, frame)
|
||||
{
|
||||
|
@ -199,7 +199,7 @@ var Factory = new Class({
|
|||
* @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
|
||||
* @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.
|
||||
*
|
||||
* @return {Phaser.Physics.Arcade.Sprite} The Sprite object that was created.
|
||||
* @return {Phaser.Types.Physics.Arcade.SpriteWithDynamicBody} The Sprite object that was created.
|
||||
*/
|
||||
sprite: function (x, y, key, frame)
|
||||
{
|
||||
|
|
|
@ -7,19 +7,6 @@
|
|||
var CONST = require('./const');
|
||||
var Extend = require('../../utils/object/Extend');
|
||||
|
||||
/**
|
||||
* @callback ArcadePhysicsCallback
|
||||
*
|
||||
* A callback receiving two Game Objects.
|
||||
*
|
||||
* When colliding a single sprite with a Group or TilemapLayer, `object1` is always the sprite.
|
||||
*
|
||||
* For all other cases, `object1` and `object2` match the same arguments in `collide()` or `overlap()`.
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject} object1 - The first Game Object.
|
||||
* @param {Phaser.GameObjects.GameObject} object2 - The second Game Object.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @namespace Phaser.Physics.Arcade
|
||||
*/
|
||||
|
|
12
src/physics/arcade/typedefs/ArcadePhysicsCallback.js
Normal file
12
src/physics/arcade/typedefs/ArcadePhysicsCallback.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
/**
|
||||
* @callback ArcadePhysicsCallback
|
||||
*
|
||||
* A callback receiving two Game Objects.
|
||||
*
|
||||
* When colliding a single sprite with a Group or TilemapLayer, `object1` is always the sprite.
|
||||
*
|
||||
* For all other cases, `object1` and `object2` match the same arguments in `collide()` or `overlap()`.
|
||||
*
|
||||
* @param {Phaser.Types.Physics.Arcade.GameObjectWithBody} object1 - The first Game Object.
|
||||
* @param {Phaser.Types.Physics.Arcade.GameObjectWithBody} object2 - The second Game Object.
|
||||
*/
|
5
src/physics/arcade/typedefs/GameObjectWithBody.js
Normal file
5
src/physics/arcade/typedefs/GameObjectWithBody.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
/**
|
||||
* @typedef {Phaser.GameObjects.GameObject} Phaser.Types.Physics.Arcade.GameObjectWithBody
|
||||
*
|
||||
* @property {(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody)} body
|
||||
*/
|
5
src/physics/arcade/typedefs/GameObjectWithDynamicBody.js
Normal file
5
src/physics/arcade/typedefs/GameObjectWithDynamicBody.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
/**
|
||||
* @typedef {Phaser.GameObjects.GameObject} Phaser.Types.Physics.Arcade.GameObjectWithDynamicBody
|
||||
*
|
||||
* @property {Phaser.Physics.Arcade.Body} body
|
||||
*/
|
5
src/physics/arcade/typedefs/GameObjectWithStaticBody.js
Normal file
5
src/physics/arcade/typedefs/GameObjectWithStaticBody.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
/**
|
||||
* @typedef {Phaser.GameObjects.GameObject} Phaser.Types.Physics.Arcade.GameObjectWithStaticBody
|
||||
*
|
||||
* @property {Phaser.Physics.Arcade.StaticBody} body
|
||||
*/
|
5
src/physics/arcade/typedefs/ImageWithDynamicBody.js
Normal file
5
src/physics/arcade/typedefs/ImageWithDynamicBody.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
/**
|
||||
* @typedef {Phaser.Physics.Arcade.Image} Phaser.Types.Physics.Arcade.ImageWithDynamicBody
|
||||
*
|
||||
* @property {Phaser.Physics.Arcade.Body} body
|
||||
*/
|
5
src/physics/arcade/typedefs/ImageWithStaticBody.js
Normal file
5
src/physics/arcade/typedefs/ImageWithStaticBody.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
/**
|
||||
* @typedef {Phaser.Physics.Arcade.Image} Phaser.Types.Physics.Arcade.ImageWithStaticBody
|
||||
*
|
||||
* @property {Phaser.Physics.Arcade.StaticBody} body
|
||||
*/
|
5
src/physics/arcade/typedefs/SpriteWithDynamicBody.js
Normal file
5
src/physics/arcade/typedefs/SpriteWithDynamicBody.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
/**
|
||||
* @typedef {Phaser.Physics.Arcade.Sprite} Phaser.Types.Physics.Arcade.SpriteWithDynamicBody
|
||||
*
|
||||
* @property {Phaser.Physics.Arcade.Body} body
|
||||
*/
|
5
src/physics/arcade/typedefs/SpriteWithStaticBody.js
Normal file
5
src/physics/arcade/typedefs/SpriteWithStaticBody.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
/**
|
||||
* @typedef {Phaser.Physics.Arcade.Sprite} Phaser.Types.Physics.Arcade.SpriteWithStaticBody
|
||||
*
|
||||
* @property {Phaser.Physics.Arcade.StaticBody} body
|
||||
*/
|
Loading…
Reference in a new issue