mirror of
https://github.com/photonstorm/phaser
synced 2024-11-22 04:33:31 +00:00
Fix multiple types on Physics, Texture and Input
This commit is contained in:
parent
7e05b333a0
commit
dca7996179
24 changed files with 79 additions and 79 deletions
|
@ -1010,7 +1010,7 @@ var InputPlugin = new Class({
|
|||
* @method Phaser.Input.InputPlugin#setDraggable
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} gameObjects - An array of Game Objects to change the draggable state on.
|
||||
* @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to change the draggable state on.
|
||||
* @param {boolean} [value=true] - Set to `true` if the Game Objects should be made draggable, `false` if they should be unset.
|
||||
*
|
||||
* @return {Phaser.Input.InputPlugin} This InputPlugin object.
|
||||
|
@ -1051,7 +1051,7 @@ var InputPlugin = new Class({
|
|||
* @method Phaser.Input.InputPlugin#setHitArea
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} gameObjects - An array of Game Objects to set the hit area on.
|
||||
* @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set the hit area on.
|
||||
* @param {object} [shape] - The shape or object to check if the pointer is within for hit area checks.
|
||||
* @param {HitAreaCallback} [callback] - The 'contains' function to invoke to check if the pointer is within the hit area.
|
||||
*
|
||||
|
@ -1087,7 +1087,7 @@ var InputPlugin = new Class({
|
|||
* @method Phaser.Input.InputPlugin#setHitAreaCircle
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} gameObjects - An array of Game Objects to set as having a circle hit area.
|
||||
* @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set as having a circle hit area.
|
||||
* @param {number} x - The center of the circle.
|
||||
* @param {number} y - The center of the circle.
|
||||
* @param {number} radius - The radius of the circle.
|
||||
|
@ -1110,7 +1110,7 @@ var InputPlugin = new Class({
|
|||
* @method Phaser.Input.InputPlugin#setHitAreaEllipse
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} gameObjects - An array of Game Objects to set as having an ellipse hit area.
|
||||
* @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set as having an ellipse hit area.
|
||||
* @param {number} x - The center of the ellipse.
|
||||
* @param {number} y - The center of the ellipse.
|
||||
* @param {number} width - The width of the ellipse.
|
||||
|
@ -1134,7 +1134,7 @@ var InputPlugin = new Class({
|
|||
* @method Phaser.Input.InputPlugin#setHitAreaFromTexture
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} gameObjects - An array of Game Objects to set as having an ellipse hit area.
|
||||
* @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set as having an ellipse hit area.
|
||||
* @param {HitAreaCallback} [callback] - The hit area callback. If undefined it uses Rectangle.Contains.
|
||||
*
|
||||
* @return {Phaser.Input.InputPlugin} This InputPlugin object.
|
||||
|
@ -1184,7 +1184,7 @@ var InputPlugin = new Class({
|
|||
* @method Phaser.Input.InputPlugin#setHitAreaRectangle
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} gameObjects - An array of Game Objects to set as having a rectangular hit area.
|
||||
* @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set as having a rectangular hit area.
|
||||
* @param {number} x - The top-left of the rectangle.
|
||||
* @param {number} y - The top-left of the rectangle.
|
||||
* @param {number} width - The width of the rectangle.
|
||||
|
@ -1208,7 +1208,7 @@ var InputPlugin = new Class({
|
|||
* @method Phaser.Input.InputPlugin#setHitAreaTriangle
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} gameObjects - An array of Game Objects to set as having a triangular hit area.
|
||||
* @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set as having a triangular hit area.
|
||||
* @param {number} x1 - The x coordinate of the first point of the triangle.
|
||||
* @param {number} y1 - The y coordinate of the first point of the triangle.
|
||||
* @param {number} x2 - The x coordinate of the second point of the triangle.
|
||||
|
|
|
@ -270,9 +270,9 @@ var Pointer = new Class({
|
|||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Cameras.Scene2D.Camera} camera - [description]
|
||||
* @param {Phaser.Math.Vector2|object} output - [description]
|
||||
* @param {(Phaser.Math.Vector2|object)} output - [description]
|
||||
*
|
||||
* @return {Phaser.Math.Vector2|object} [description]
|
||||
* @return {(Phaser.Math.Vector2|object)} [description]
|
||||
*/
|
||||
positionToCamera: function (camera, output)
|
||||
{
|
||||
|
|
|
@ -239,7 +239,7 @@ var KeyboardManager = new Class({
|
|||
* @method Phaser.Input.Keyboard.KeyboardManager#addKey
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {string|integer} keyCode - [description]
|
||||
* @param {(string|integer)} keyCode - [description]
|
||||
*
|
||||
* @return {Phaser.Input.Keyboard.Key} [description]
|
||||
*/
|
||||
|
@ -262,7 +262,7 @@ var KeyboardManager = new Class({
|
|||
* @method Phaser.Input.Keyboard.KeyboardManager#removeKey
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {string|integer} keyCode - [description]
|
||||
* @param {(string|integer)} keyCode - [description]
|
||||
*/
|
||||
removeKey: function (keyCode)
|
||||
{
|
||||
|
@ -279,7 +279,7 @@ var KeyboardManager = new Class({
|
|||
* @method Phaser.Input.Keyboard.KeyboardManager#addKeyCapture
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {string|integer|string[]|integer[]} keyCodes - [description]
|
||||
* @param {(string|integer|string[]|integer[])} keyCodes - [description]
|
||||
*/
|
||||
addKeyCapture: function (keyCodes)
|
||||
{
|
||||
|
@ -300,7 +300,7 @@ var KeyboardManager = new Class({
|
|||
* @method Phaser.Input.Keyboard.KeyboardManager#removeKeyCapture
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {string|integer|string[]|integer[]} keyCodes - [description]
|
||||
* @param {(string|integer|string[]|integer[])} keyCodes - [description]
|
||||
*/
|
||||
removeKeyCapture: function (keyCodes)
|
||||
{
|
||||
|
@ -321,7 +321,7 @@ var KeyboardManager = new Class({
|
|||
* @method Phaser.Input.Keyboard.KeyboardManager#createCombo
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {string|integer[]|object[]} keys - [description]
|
||||
* @param {(string|integer[]|object[])} keys - [description]
|
||||
* @param {object} config - [description]
|
||||
*
|
||||
* @return {Phaser.Input.Keyboard.KeyCombo} [description]
|
||||
|
|
|
@ -31,7 +31,7 @@ var ResetKeyCombo = require('./ResetKeyCombo');
|
|||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Input.Keyboard.KeyboardManager} keyboardManager - [description]
|
||||
* @param {string|integer[]|object[]} keys - [description]
|
||||
* @param {(string|integer[]|object[])} keys - [description]
|
||||
* @param {object} [config] - [description]
|
||||
*/
|
||||
var KeyCombo = new Class({
|
||||
|
|
|
@ -11,7 +11,7 @@ var Image = require('../../gameobjects/image/Image');
|
|||
/**
|
||||
* @classdesc
|
||||
* An Arcade Physics Image Game Object.
|
||||
*
|
||||
*
|
||||
* An Image is a light-weight Game Object useful for the display of static images in your game,
|
||||
* such as logos, backgrounds, scenery or other non-animated elements. Images can have input
|
||||
* events and physics bodies, or be tweened, tinted or scrolled. The main difference between an
|
||||
|
@ -54,7 +54,7 @@ var Image = require('../../gameobjects/image/Image');
|
|||
* @param {number} x - The horizontal position of this Game Object in the world.
|
||||
* @param {number} y - The vertical position of this Game Object in the world.
|
||||
* @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.
|
||||
* @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.
|
||||
*/
|
||||
var ArcadeImage = new Class({
|
||||
|
||||
|
|
|
@ -142,8 +142,8 @@ var ArcadePhysics = new Class({
|
|||
* @method Phaser.Physics.Arcade.ArcadePhysics#overlap
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject|array} object1 - The first object or array of objects to check. Can be any Game Object that has an Arcade Physics Body.
|
||||
* @param {Phaser.GameObjects.GameObject|array} object2 - The second object or array of objects to check. Can be any Game Object that has an Arcade Physics Body.
|
||||
* @param {(Phaser.GameObjects.GameObject|array)} object1 - The first object or array of objects to check. Can be any Game Object that has an Arcade Physics Body.
|
||||
* @param {(Phaser.GameObjects.GameObject|array)} object2 - The second object or array of objects to check. Can be any Game Object that has an Arcade Physics Body.
|
||||
* @param {ArcadePhysicsCallback} [overlapCallback=null] - An optional callback function that is called if the objects overlap. The two objects will be passed to this function in the same order in which you specified them, unless you are checking Group vs. Sprite, in which case Sprite will always be the first parameter.
|
||||
* @param {ArcadePhysicsCallback} [processCallback=null] - A callback function that lets you perform additional checks against the two objects if they overlap. If this is set then `overlapCallback` will only be called if this callback returns `true`.
|
||||
* @param {object} [callbackContext] - The context in which to run the callbacks.
|
||||
|
@ -165,8 +165,8 @@ var ArcadePhysics = new Class({
|
|||
* @method Phaser.Physics.Arcade.ArcadePhysics#collide
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject|array} object1 - The first object or array of objects to check. Can be any Game Object that has an Arcade Physics Body.
|
||||
* @param {Phaser.GameObjects.GameObject|array} object2 - The second object or array of objects to check. Can be any Game Object that has an Arcade Physics Body.
|
||||
* @param {(Phaser.GameObjects.GameObject|array)} object1 - The first object or array of objects to check. Can be any Game Object that has an Arcade Physics Body.
|
||||
* @param {(Phaser.GameObjects.GameObject|array)} object2 - The second object or array of objects to check. Can be any Game Object that has an Arcade Physics Body.
|
||||
* @param {ArcadePhysicsCallback} [collideCallback=null] - An optional callback function that is called if the objects collide. The two objects will be passed to this function in the same order in which you specified them, unless you are checking Group vs. Sprite, in which case Sprite will always be the first parameter.
|
||||
* @param {ArcadePhysicsCallback} [processCallback=null] - A callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`.
|
||||
* @param {object} [callbackContext] - The context in which to run the callbacks.
|
||||
|
|
|
@ -58,7 +58,7 @@ var Sprite = require('../../gameobjects/sprite/Sprite');
|
|||
* @param {number} x - The horizontal position of this Game Object in the world.
|
||||
* @param {number} y - The vertical position of this Game Object in the world.
|
||||
* @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.
|
||||
* @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.
|
||||
*/
|
||||
var ArcadeSprite = new Class({
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@ var Factory = new Class({
|
|||
* @param {number} x - The horizontal position of this Game Object in the world.
|
||||
* @param {number} y - The vertical position of this Game Object in the world.
|
||||
* @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.
|
||||
* @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.
|
||||
*/
|
||||
|
@ -148,7 +148,7 @@ var Factory = new Class({
|
|||
* @param {number} x - The horizontal position of this Game Object in the world.
|
||||
* @param {number} y - The vertical position of this Game Object in the world.
|
||||
* @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.
|
||||
* @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.
|
||||
*/
|
||||
|
@ -172,7 +172,7 @@ var Factory = new Class({
|
|||
* @param {number} x - The horizontal position of this Game Object in the world.
|
||||
* @param {number} y - The vertical position of this Game Object in the world.
|
||||
* @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.
|
||||
* @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.
|
||||
*/
|
||||
|
@ -197,7 +197,7 @@ var Factory = new Class({
|
|||
* @param {number} x - The horizontal position of this Game Object in the world.
|
||||
* @param {number} y - The vertical position of this Game Object in the world.
|
||||
* @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.
|
||||
* @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.
|
||||
*/
|
||||
|
|
|
@ -267,7 +267,7 @@ var World = new Class({
|
|||
* @method Phaser.Physics.Arcade.World#enable
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} object - [description]
|
||||
* @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} object - [description]
|
||||
* @param {integer} [bodyType] - The type of Body to create. Either `DYNAMIC_BODY` or `STATIC_BODY`.
|
||||
*/
|
||||
enable: function (object, bodyType)
|
||||
|
@ -357,7 +357,7 @@ var World = new Class({
|
|||
* @method Phaser.Physics.Arcade.World#disable
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} object - [description]
|
||||
* @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} object - [description]
|
||||
*/
|
||||
disable: function (object)
|
||||
{
|
||||
|
@ -1531,7 +1531,7 @@ var World = new Class({
|
|||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.Group} group - [description]
|
||||
* @param {Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer} tilemapLayer - [description]
|
||||
* @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - [description]
|
||||
* @param {ArcadePhysicsCallback} collideCallback - [description]
|
||||
* @param {ArcadePhysicsCallback} processCallback - [description]
|
||||
* @param {object} callbackContext - [description]
|
||||
|
@ -1571,7 +1571,7 @@ var World = new Class({
|
|||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject} sprite - [description]
|
||||
* @param {Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer} tilemapLayer - [description]
|
||||
* @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - [description]
|
||||
* @param {ArcadePhysicsCallback} collideCallback - [description]
|
||||
* @param {ArcadePhysicsCallback} processCallback - [description]
|
||||
* @param {object} callbackContext - [description]
|
||||
|
|
|
@ -18,7 +18,7 @@ var TileIntersectsBody = require('./TileIntersectsBody');
|
|||
* @param {Phaser.Physics.Arcade.Body} body - The Body object to separate.
|
||||
* @param {Phaser.Tilemaps.Tile} tile - The tile to collide against.
|
||||
* @param {Phaser.Geom.Rectangle} tileWorldRect - [description]
|
||||
* @param {Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer} tilemapLayer - The tilemapLayer to collide against.
|
||||
* @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - The tilemapLayer to collide against.
|
||||
* @param {number} tileBias - [description]
|
||||
*
|
||||
* @return {boolean} Returns true if the body was separated, otherwise false.
|
||||
|
|
|
@ -98,7 +98,7 @@ var Factory = new Class({
|
|||
* @param {number} x - The horizontal position of this Game Object in the world.
|
||||
* @param {number} y - The vertical position of this Game Object in the world.
|
||||
* @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.
|
||||
* @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.
|
||||
*
|
||||
* @return {Phaser.Physics.Impact.ImpactImage} The ImpactImage object that was created.
|
||||
*/
|
||||
|
@ -120,7 +120,7 @@ var Factory = new Class({
|
|||
* @param {number} x - The horizontal position of this Game Object in the world.
|
||||
* @param {number} y - The vertical position of this Game Object in the world.
|
||||
* @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.
|
||||
* @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.
|
||||
*
|
||||
* @return {Phaser.Physics.Impact.ImpactSprite} The ImpactSprite object that was created.
|
||||
*/
|
||||
|
|
|
@ -54,7 +54,7 @@ var Image = require('../../gameobjects/image/Image');
|
|||
* @param {number} x - The horizontal position of this Game Object in the world.
|
||||
* @param {number} y - The vertical position of this Game Object in the world.
|
||||
* @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.
|
||||
* @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.
|
||||
*/
|
||||
var ImpactImage = new Class({
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ var Sprite = require('../../gameobjects/sprite/Sprite');
|
|||
* @param {number} x - The horizontal position of this Game Object in the world.
|
||||
* @param {number} y - The vertical position of this Game Object in the world.
|
||||
* @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.
|
||||
* @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.
|
||||
*/
|
||||
var ImpactSprite = new Class({
|
||||
|
||||
|
|
|
@ -222,7 +222,7 @@ var World = new Class({
|
|||
* @method Phaser.Physics.Impact.World#setCollisionMap
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {string|integer[][]} key - Either a string key that corresponds to a Weltmeister level
|
||||
* @param {(string|integer[][])} key - Either a string key that corresponds to a Weltmeister level
|
||||
* in the cache, or a 2D array of collision IDs.
|
||||
* @param {integer} tileSize - The size of a tile. This is optional if loading from a Weltmeister
|
||||
* level in the cache.
|
||||
|
@ -278,7 +278,7 @@ var World = new Class({
|
|||
* @method Phaser.Physics.Impact.World#setCollisionMapFromTilemapLayer
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {StaticTilemapLayer|DynamicTilemapLayer} tilemapLayer - The tilemap layer to use.
|
||||
* @param {(StaticTilemapLayer|DynamicTilemapLayer)} tilemapLayer - The tilemap layer to use.
|
||||
* @param {object} [options] - Options for controlling the mapping from tiles to slope IDs.
|
||||
* @param {string} [options.slopeTileProperty=null] - Slope IDs can be stored on tiles directly
|
||||
* using Tiled's tileset editor. If a tile has a property with the given slopeTileProperty string
|
||||
|
|
|
@ -185,7 +185,7 @@ var Factory = new Class({
|
|||
* @since 3.0.0
|
||||
*
|
||||
* @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.
|
||||
* @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.
|
||||
* @param {number} x - The horizontal position of this composite in the world.
|
||||
* @param {number} y - The vertical position of this composite in the world.
|
||||
* @param {number} columns - The number of columns in the grid.
|
||||
|
@ -527,7 +527,7 @@ var Factory = new Class({
|
|||
* @param {number} x - The horizontal position of this Game Object in the world.
|
||||
* @param {number} y - The vertical position of this Game Object in the world.
|
||||
* @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.
|
||||
* @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.
|
||||
* @param {object} options - [description]
|
||||
*
|
||||
* @return {Phaser.Physics.Matter.MatterImage} [description]
|
||||
|
@ -568,7 +568,7 @@ var Factory = new Class({
|
|||
* @param {number} x - The horizontal position of this Game Object in the world.
|
||||
* @param {number} y - The vertical position of this Game Object in the world.
|
||||
* @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.
|
||||
* @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.
|
||||
* @param {object} options - [description]
|
||||
*
|
||||
* @return {Phaser.Physics.Matter.MatterSprite} [description]
|
||||
|
|
|
@ -59,7 +59,7 @@ var Vector2 = require('../../math/Vector2');
|
|||
* @param {number} x - The horizontal position of this Game Object in the world.
|
||||
* @param {number} y - The vertical position of this Game Object in the world.
|
||||
* @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.
|
||||
* @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.
|
||||
* @param {object} options - [description]
|
||||
*/
|
||||
var MatterImage = new Class({
|
||||
|
|
|
@ -64,7 +64,7 @@ var Vector2 = require('../../math/Vector2');
|
|||
* @param {number} x - The horizontal position of this Game Object in the world.
|
||||
* @param {number} y - The vertical position of this Game Object in the world.
|
||||
* @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.
|
||||
* @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.
|
||||
* @param {object} options - [description]
|
||||
*/
|
||||
var MatterSprite = new Class({
|
||||
|
|
|
@ -418,7 +418,7 @@ var World = new Class({
|
|||
* @method Phaser.Physics.Matter.World#add
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {object|object[]} object - Can be single or an array, and can be a body, composite or constraint
|
||||
* @param {(object|object[])} object - Can be single or an array, and can be a body, composite or constraint
|
||||
*
|
||||
* @return {Phaser.Physics.Matter.World} This Matter World object.
|
||||
*/
|
||||
|
@ -474,7 +474,7 @@ var World = new Class({
|
|||
* @method Phaser.Physics.Matter.World#convertTilemapLayer
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.StaticTilemapLayer|Phaser.GameObjects.DynamicTilemapLayer} tilemapLayer -
|
||||
* @param {(Phaser.GameObjects.StaticTilemapLayer|Phaser.GameObjects.DynamicTilemapLayer)} tilemapLayer -
|
||||
* An array of tiles.
|
||||
* @param {object} [options] - Options to be passed to the MatterTileBody constructor. {@ee Phaser.Physics.Matter.TileBody}
|
||||
*
|
||||
|
|
|
@ -52,7 +52,7 @@ var Collision = {
|
|||
* @method Phaser.Physics.Matter.Components.Collision#setCollidesWith
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number|number[]} categories - A unique category bitfield, or an array of them.
|
||||
* @param {(number|number[])} categories - A unique category bitfield, or an array of them.
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} This Game Object.
|
||||
*/
|
||||
|
|
|
@ -64,7 +64,7 @@ var MatterAttractors = {
|
|||
if (Matter.Common.isFunction(attractor)) {
|
||||
forceVector = attractor(bodyA, bodyB);
|
||||
}
|
||||
|
||||
|
||||
if (forceVector) {
|
||||
Matter.Body.applyForce(bodyB, bodyB.position, forceVector);
|
||||
}
|
||||
|
@ -74,9 +74,9 @@ var MatterAttractors = {
|
|||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Defines some useful common attractor functions that can be used
|
||||
* Defines some useful common attractor functions that can be used
|
||||
* by pushing them to your body's `body.plugin.attractors` array.
|
||||
* @namespace MatterAttractors.Attractors
|
||||
* @property {number} gravityConstant The gravitational constant used by the gravity attractor.
|
||||
|
@ -87,7 +87,7 @@ var MatterAttractors = {
|
|||
/**
|
||||
* An attractor function that applies Newton's law of gravitation.
|
||||
* Use this by pushing `MatterAttractors.Attractors.gravity` to your body's `body.plugin.attractors` array.
|
||||
* The gravitational constant defaults to `0.001` which you can change
|
||||
* The gravitational constant defaults to `0.001` which you can change
|
||||
* at `MatterAttractors.Attractors.gravityConstant`.
|
||||
* @function MatterAttractors.Attractors.gravity
|
||||
* @param {Matter.Body} bodyA The first body.
|
||||
|
@ -117,7 +117,7 @@ module.exports = MatterAttractors;
|
|||
*/
|
||||
|
||||
/**
|
||||
* This plugin adds a new property `body.plugin.attractors` to instances of `Matter.Body`.
|
||||
* This plugin adds a new property `body.plugin.attractors` to instances of `Matter.Body`.
|
||||
* This is an array of callback functions that will be called automatically
|
||||
* for every pair of bodies, on every engine update.
|
||||
* @property {Function[]} body.plugin.attractors
|
||||
|
@ -132,5 +132,5 @@ module.exports = MatterAttractors;
|
|||
* @callback AttractorFunction
|
||||
* @param {Matter.Body} bodyA
|
||||
* @param {Matter.Body} bodyB
|
||||
* @returns {Vector|undefined} a force vector (optional)
|
||||
*/
|
||||
* @returns {(Vector|undefined)} a force vector (optional)
|
||||
*/
|
||||
|
|
|
@ -17,7 +17,7 @@ var Extend = require('../utils/object/Extend');
|
|||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Textures.Texture} texture - The Texture this Frame is a part of.
|
||||
* @param {integer|string} name - The name of this Frame. The name is unique within the Texture.
|
||||
* @param {(integer|string)} name - The name of this Frame. The name is unique within the Texture.
|
||||
* @param {integer} sourceIndex - The index of the TextureSource that this Frame is a part of.
|
||||
* @param {number} x - The x coordinate of the top-left of this Frame.
|
||||
* @param {number} y - The y coordinate of the top-left of this Frame.
|
||||
|
@ -211,7 +211,7 @@ var Frame = new Class({
|
|||
|
||||
/**
|
||||
* **CURRENTLY UNSUPPORTED**
|
||||
*
|
||||
*
|
||||
* Is this frame is rotated or not in the Texture?
|
||||
* Rotation allows you to use rotated frames in texture atlas packing.
|
||||
* It has nothing to do with Sprite rotation.
|
||||
|
@ -374,7 +374,7 @@ var Frame = new Class({
|
|||
var tw = this.source.width;
|
||||
var th = this.source.height;
|
||||
var uvs = this.data.uvs;
|
||||
|
||||
|
||||
uvs.x0 = cx / tw;
|
||||
uvs.y0 = cy / th;
|
||||
|
||||
|
@ -403,16 +403,16 @@ var Frame = new Class({
|
|||
var tw = this.source.width;
|
||||
var th = this.source.height;
|
||||
var uvs = this.data.uvs;
|
||||
|
||||
|
||||
uvs.x3 = (this.cutX + this.cutHeight) / tw;
|
||||
uvs.y3 = (this.cutY + this.cutWidth) / th;
|
||||
|
||||
uvs.x2 = this.cutX / tw;
|
||||
uvs.y2 = (this.cutY + this.cutWidth) / th;
|
||||
|
||||
|
||||
uvs.x1 = this.cutX / tw;
|
||||
uvs.y1 = this.cutY / th;
|
||||
|
||||
|
||||
uvs.x0 = (this.cutX + this.cutHeight) / tw;
|
||||
uvs.y0 = this.cutY / th;
|
||||
|
||||
|
@ -525,7 +525,7 @@ var Frame = new Class({
|
|||
|
||||
/**
|
||||
* The radius of the Frame (derived from sqrt(w * w + h * h) / 2)
|
||||
*
|
||||
*
|
||||
* @name Phaser.Textures.Frame#radius
|
||||
* @type {number}
|
||||
* @readOnly
|
||||
|
@ -542,7 +542,7 @@ var Frame = new Class({
|
|||
|
||||
/**
|
||||
* Is the Frame trimmed or not?
|
||||
*
|
||||
*
|
||||
* @name Phaser.Textures.Frame#trimmed
|
||||
* @type {boolean}
|
||||
* @readOnly
|
||||
|
@ -559,7 +559,7 @@ var Frame = new Class({
|
|||
|
||||
/**
|
||||
* The Canvas drawImage data object.
|
||||
*
|
||||
*
|
||||
* @name Phaser.Textures.Frame#canvasData
|
||||
* @type {object}
|
||||
* @readOnly
|
||||
|
|
|
@ -27,7 +27,7 @@ var TextureSource = require('./TextureSource');
|
|||
*
|
||||
* @param {Phaser.Textures.TextureManager} manager - A reference to the Texture Manager this Texture belongs to.
|
||||
* @param {string} key - The unique string-based key of this Texture.
|
||||
* @param {Image|HTMLCanvasElement} source - The source that is used to create the texture. Usually an Image, but can also be a Canvas.
|
||||
* @param {(Image|HTMLCanvasElement)} source - The source that is used to create the texture. Usually an Image, but can also be a Canvas.
|
||||
* @param {number} [width] - The width of the Texture. This is optional and automatically derived from the source images.
|
||||
* @param {number} [height] - The height of the Texture. This is optional and automatically derived from the source images.
|
||||
*/
|
||||
|
@ -133,7 +133,7 @@ var Texture = new Class({
|
|||
* @method Phaser.Textures.Texture#add
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {integer|string} name - The name of this Frame. The name is unique within the Texture.
|
||||
* @param {(integer|string)} name - The name of this Frame. The name is unique within the Texture.
|
||||
* @param {integer} sourceIndex - The index of the TextureSource that this Frame is a part of.
|
||||
* @param {number} x - The x coordinate of the top-left of this Frame.
|
||||
* @param {number} y - The y coordinate of the top-left of this Frame.
|
||||
|
@ -187,7 +187,7 @@ var Texture = new Class({
|
|||
* @method Phaser.Textures.Texture#get
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {string|integer} [name] - The string-based name, or integer based index, of the Frame to get from this Texture.
|
||||
* @param {(string|integer)} [name] - The string-based name, or integer based index, of the Frame to get from this Texture.
|
||||
*
|
||||
* @return {Phaser.Textures.Frame} The Texture Frame.
|
||||
*/
|
||||
|
@ -204,10 +204,10 @@ var Texture = new Class({
|
|||
if (!frame)
|
||||
{
|
||||
console.warn('No Texture.frame found with name ' + name);
|
||||
|
||||
|
||||
frame = this.frames[this.firstFrame];
|
||||
}
|
||||
|
||||
|
||||
return frame;
|
||||
},
|
||||
|
||||
|
@ -271,7 +271,7 @@ var Texture = new Class({
|
|||
|
||||
/**
|
||||
* Returns an array with all of the names of the Frames in this Texture.
|
||||
*
|
||||
*
|
||||
* Useful if you want to randomly assign a Frame to a Game Object, as you can
|
||||
* pick a random element from the returned array.
|
||||
*
|
||||
|
@ -309,9 +309,9 @@ var Texture = new Class({
|
|||
* @method Phaser.Textures.Texture#getSourceImage
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {string|integer} [name] - The string-based name, or integer based index, of the Frame to get from this Texture.
|
||||
* @param {(string|integer)} [name] - The string-based name, or integer based index, of the Frame to get from this Texture.
|
||||
*
|
||||
* @return {HTMLImageElement|HTMLCanvasElement} The DOM Image or Canvas Element.
|
||||
* @return {(HTMLImageElement|HTMLCanvasElement)} The DOM Image or Canvas Element.
|
||||
*/
|
||||
getSourceImage: function (name)
|
||||
{
|
||||
|
@ -336,14 +336,14 @@ var Texture = new Class({
|
|||
|
||||
/**
|
||||
* Adds a data source image to this Texture.
|
||||
*
|
||||
*
|
||||
* An example of a data source image would be a normal map, where all of the Frames for this Texture
|
||||
* equally apply to the normal map.
|
||||
*
|
||||
* @method Phaser.Textures.Texture#setDataSource
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Image|HTMLCanvasElement} data - The source image.
|
||||
* @param {(Image|HTMLCanvasElement)} data - The source image.
|
||||
*/
|
||||
setDataSource: function (data)
|
||||
{
|
||||
|
@ -372,7 +372,7 @@ var Texture = new Class({
|
|||
* @method Phaser.Textures.Texture#setFilter
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Textures.FilterMode.LINEAR|Phaser.Textures.FilterMode.NEAREST} filterMode - The Filter Mode.
|
||||
* @param {(Phaser.Textures.FilterMode.LINEAR|Phaser.Textures.FilterMode.NEAREST)} filterMode - The Filter Mode.
|
||||
*/
|
||||
setFilter: function (filterMode)
|
||||
{
|
||||
|
|
|
@ -611,7 +611,7 @@ var TextureManager = new Class({
|
|||
* @since 3.0.0
|
||||
*
|
||||
* @param {string} key - The unique string-based key of the Texture.
|
||||
* @param {string|integer} frame - The string or index of the Frame to be cloned.
|
||||
* @param {(string|integer)} frame - The string or index of the Frame to be cloned.
|
||||
*
|
||||
* @return {Phaser.Textures.Frame} A Clone of the given Frame.
|
||||
*/
|
||||
|
@ -630,7 +630,7 @@ var TextureManager = new Class({
|
|||
* @since 3.0.0
|
||||
*
|
||||
* @param {string} key - The unique string-based key of the Texture.
|
||||
* @param {string|integer} frame - The string or index of the Frame.
|
||||
* @param {(string|integer)} frame - The string or index of the Frame.
|
||||
*
|
||||
* @return {Phaser.Textures.Frame} A Texture Frame object.
|
||||
*/
|
||||
|
@ -677,7 +677,7 @@ var TextureManager = new Class({
|
|||
* @param {integer} x - The x coordinate of the pixel within the Texture.
|
||||
* @param {integer} y - The y coordinate of the pixel within the Texture.
|
||||
* @param {string} key - The unique string-based key of the Texture.
|
||||
* @param {string|integer} frame - The string or index of the Frame.
|
||||
* @param {(string|integer)} frame - The string or index of the Frame.
|
||||
*
|
||||
* @return {?Phaser.Display.Color} A Color object populated with the color values of the requested pixel,
|
||||
* or `null` if the coordinates were out of bounds.
|
||||
|
@ -724,7 +724,7 @@ var TextureManager = new Class({
|
|||
*
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
|
||||
* @param {string} key - The unique string-based key of the Texture.
|
||||
* @param {string|integer} frame - The string or index of the Frame.
|
||||
* @param {(string|integer)} frame - The string or index of the Frame.
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} The Game Object the texture was set on.
|
||||
*/
|
||||
|
|
|
@ -22,7 +22,7 @@ var ScaleModes = require('../renderer/ScaleModes');
|
|||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Textures.Texture} texture - The Texture this TextureSource belongs to.
|
||||
* @param {Image|HTMLCanvasElement} source - The source image data.
|
||||
* @param {(Image|HTMLCanvasElement)} source - The source image data.
|
||||
* @param {integer} [width] - Optional width of the source image. If not given it's derived from the source itself.
|
||||
* @param {integer} [height] - Optional height of the source image. If not given it's derived from the source itself.
|
||||
*/
|
||||
|
@ -47,7 +47,7 @@ var TextureSource = new Class({
|
|||
* The source image data. This is either an Image Element, or a Canvas Element.
|
||||
*
|
||||
* @name Phaser.Textures.TextureSource#image
|
||||
* @type {HTMLImageElement|HTMLCanvasElement}
|
||||
* @type {(HTMLImageElement|HTMLCanvasElement)}
|
||||
* @since 3.0.0
|
||||
*/
|
||||
this.image = source;
|
||||
|
@ -164,7 +164,7 @@ var TextureSource = new Class({
|
|||
* @method Phaser.Textures.TextureSource#setFilter
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Textures.FilterMode.LINEAR|Phaser.Textures.FilterMode.NEAREST} filterMode - The Filter Mode.
|
||||
* @param {(Phaser.Textures.FilterMode.LINEAR|Phaser.Textures.FilterMode.NEAREST)} filterMode - The Filter Mode.
|
||||
*/
|
||||
setFilter: function (filterMode)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue