mirror of
https://github.com/wassname/phaser.git
synced 2026-08-03 13:10:25 +08:00
More docs coming on.
This commit is contained in:
+17
-17
@@ -27,43 +27,43 @@ Phaser.Tile = function (game, tilemap, index, width, height) {
|
||||
this.mass = 1.0;
|
||||
|
||||
/**
|
||||
* @property {bool} collideNone - Indicating this Tile doesn't collide at all.
|
||||
* @property {boolean} collideNone - Indicating this Tile doesn't collide at all.
|
||||
* @default
|
||||
*/
|
||||
this.collideNone = true;
|
||||
|
||||
/**
|
||||
* @property {bool} collideLeft - Indicating collide with any object on the left.
|
||||
* @property {boolean} collideLeft - Indicating collide with any object on the left.
|
||||
* @default
|
||||
*/
|
||||
this.collideLeft = false;
|
||||
|
||||
/**
|
||||
* @property {bool} collideRight - Indicating collide with any object on the right.
|
||||
* @property {boolean} collideRight - Indicating collide with any object on the right.
|
||||
* @default
|
||||
*/
|
||||
this.collideRight = false;
|
||||
|
||||
/**
|
||||
* @property {bool} collideUp - Indicating collide with any object on the top.
|
||||
* @property {boolean} collideUp - Indicating collide with any object on the top.
|
||||
* @default
|
||||
*/
|
||||
this.collideUp = false;
|
||||
|
||||
/**
|
||||
* @property {bool} collideDown - Indicating collide with any object on the bottom.
|
||||
* @property {boolean} collideDown - Indicating collide with any object on the bottom.
|
||||
* @default
|
||||
*/
|
||||
this.collideDown = false;
|
||||
|
||||
/**
|
||||
* @property {bool} separateX - Enable separation at x-axis.
|
||||
* @property {boolean} separateX - Enable separation at x-axis.
|
||||
* @default
|
||||
*/
|
||||
this.separateX = true;
|
||||
|
||||
/**
|
||||
* @property {bool} separateY - Enable separation at y-axis.
|
||||
* @property {boolean} separateY - Enable separation at y-axis.
|
||||
* @default
|
||||
*/
|
||||
this.separateY = true;
|
||||
@@ -74,7 +74,7 @@ Phaser.Tile = function (game, tilemap, index, width, height) {
|
||||
this.game = game;
|
||||
|
||||
/**
|
||||
* @property {bool} tilemap - The tilemap this tile belongs to.
|
||||
* @property {boolean} tilemap - The tilemap this tile belongs to.
|
||||
*/
|
||||
this.tilemap = tilemap;
|
||||
|
||||
@@ -108,13 +108,13 @@ Phaser.Tile.prototype = {
|
||||
/**
|
||||
* Set collision configs.
|
||||
* @method setCollision
|
||||
* @param {bool} left - Indicating collide with any object on the left.
|
||||
* @param {bool} right - Indicating collide with any object on the right.
|
||||
* @param {bool} up - Indicating collide with any object on the top.
|
||||
* @param {bool} down - Indicating collide with any object on the bottom.
|
||||
* @param {bool} reset - Description.
|
||||
* @param {bool} separateX - Separate at x-axis.
|
||||
* @param {bool} separateY - Separate at y-axis.
|
||||
* @param {boolean} left - Indicating collide with any object on the left.
|
||||
* @param {boolean} right - Indicating collide with any object on the right.
|
||||
* @param {boolean} up - Indicating collide with any object on the top.
|
||||
* @param {boolean} down - Indicating collide with any object on the bottom.
|
||||
* @param {boolean} reset - Description.
|
||||
* @param {boolean} separateX - Separate at x-axis.
|
||||
* @param {boolean} separateY - Separate at y-axis.
|
||||
*/
|
||||
setCollision: function (left, right, up, down, reset, separateX, separateY) {
|
||||
|
||||
@@ -160,7 +160,7 @@ Object.defineProperty(Phaser.Tile.prototype, "bottom", {
|
||||
/**
|
||||
* The sum of the y and height properties. Changing the bottom property of a Rectangle object has no effect on the x, y and width properties, but does change the height property.
|
||||
* @method bottom
|
||||
* @return {Number}
|
||||
* @return {number}
|
||||
**/
|
||||
get: function () {
|
||||
return this.y + this.height;
|
||||
@@ -174,7 +174,7 @@ Object.defineProperty(Phaser.Tile.prototype, "right", {
|
||||
* The sum of the x and width properties. Changing the right property of a Rectangle object has no effect on the x, y and height properties.
|
||||
* However it does affect the width property.
|
||||
* @method right
|
||||
* @return {Number}
|
||||
* @return {number}
|
||||
**/
|
||||
get: function () {
|
||||
return this.x + this.width;
|
||||
|
||||
+18
-18
@@ -16,7 +16,7 @@
|
||||
* @param {string} key - Asset key for this map.
|
||||
* @param {object} x - Description.
|
||||
* @param {object} y - Description.
|
||||
* @param {bool} resizeWorld - Resize the world bound automatically based on this tilemap?
|
||||
* @param {boolean} resizeWorld - Resize the world bound automatically based on this tilemap?
|
||||
* @param {number} tileWidth - Width of tiles in this map (used for CSV maps).
|
||||
* @param {number} tileHeight - Height of tiles in this map (used for CSV maps).
|
||||
*/
|
||||
@@ -54,31 +54,31 @@ Phaser.Tilemap = function (game, key, x, y, resizeWorld, tileWidth, tileHeight)
|
||||
this.renderOrderID = 0;
|
||||
|
||||
/**
|
||||
* @property {bool} collisionCallback - Tilemap collision callback.
|
||||
* @property {boolean} collisionCallback - Tilemap collision callback.
|
||||
* @default
|
||||
*/
|
||||
this.collisionCallback = null;
|
||||
|
||||
/**
|
||||
* @property {bool} exists - Description.
|
||||
* @property {boolean} exists - Description.
|
||||
* @default
|
||||
*/
|
||||
this.exists = true;
|
||||
|
||||
/**
|
||||
* @property {bool} visible - Description.
|
||||
* @property {boolean} visible - Description.
|
||||
* @default
|
||||
*/
|
||||
this.visible = true;
|
||||
|
||||
/**
|
||||
* @property {bool} tiles - Description.
|
||||
* @property {boolean} tiles - Description.
|
||||
* @default
|
||||
*/
|
||||
this.tiles = [];
|
||||
|
||||
/**
|
||||
* @property {bool} layers - Description.
|
||||
* @property {boolean} layers - Description.
|
||||
* @default
|
||||
*/
|
||||
this.layers = [];
|
||||
@@ -268,9 +268,9 @@ Phaser.Tilemap.prototype.setCollisionCallback = function (context, callback) {
|
||||
* @param {number} start - First index of tiles.
|
||||
* @param {number} end - Last index of tiles.
|
||||
* @param {number} collision - Bit field of flags. (see Tile.allowCollision)
|
||||
* @param {bool} resetCollisions - Reset collision flags before set.
|
||||
* @param {bool} separateX - Enable separate at x-axis.
|
||||
* @param {bool} separateY - Enable separate at y-axis.
|
||||
* @param {boolean} resetCollisions - Reset collision flags before set.
|
||||
* @param {boolean} separateX - Enable separate at x-axis.
|
||||
* @param {boolean} separateY - Enable separate at y-axis.
|
||||
*/
|
||||
Phaser.Tilemap.prototype.setCollisionRange = function (start, end, left, right, up, down, resetCollisions, separateX, separateY) {
|
||||
|
||||
@@ -289,13 +289,13 @@ Phaser.Tilemap.prototype.setCollisionRange = function (start, end, left, right,
|
||||
* Set collision configs of tiles with given index.
|
||||
* @param {number[]} values - Index array which contains all tile indexes. The tiles with those indexes will be setup with rest parameters.
|
||||
* @param {number} collision - Bit field of flags (see Tile.allowCollision).
|
||||
* @param {bool} resetCollisions - Reset collision flags before set.
|
||||
* @param {bool} left - Indicating collide with any object on the left.
|
||||
* @param {bool} right - Indicating collide with any object on the right.
|
||||
* @param {bool} up - Indicating collide with any object on the top.
|
||||
* @param {bool} down - Indicating collide with any object on the bottom.
|
||||
* @param {bool} separateX - Enable separate at x-axis.
|
||||
* @param {bool} separateY - Enable separate at y-axis.
|
||||
* @param {boolean} resetCollisions - Reset collision flags before set.
|
||||
* @param {boolean} left - Indicating collide with any object on the left.
|
||||
* @param {boolean} right - Indicating collide with any object on the right.
|
||||
* @param {boolean} up - Indicating collide with any object on the top.
|
||||
* @param {boolean} down - Indicating collide with any object on the bottom.
|
||||
* @param {boolean} separateX - Enable separate at x-axis.
|
||||
* @param {boolean} separateY - Enable separate at y-axis.
|
||||
*/
|
||||
Phaser.Tilemap.prototype.setCollisionByIndex = function (values, left, right, up, down, resetCollisions, separateX, separateY) {
|
||||
|
||||
@@ -389,7 +389,7 @@ Phaser.Tilemap.prototype.getTileOverlaps = function (object) {
|
||||
* @param {Function} objectOrGroup - Target object of group you want to check.
|
||||
* @param {Function} callback - This is called if objectOrGroup collides the tilemap.
|
||||
* @param {object} context - Callback will be called with this context.
|
||||
* @return {bool} Return true if this collides with given object, otherwise return false.
|
||||
* @return {boolean} Return true if this collides with given object, otherwise return false.
|
||||
*/
|
||||
Phaser.Tilemap.prototype.collide = function (objectOrGroup, callback, context) {
|
||||
|
||||
@@ -417,7 +417,7 @@ Phaser.Tilemap.prototype.collide = function (objectOrGroup, callback, context) {
|
||||
/**
|
||||
* Check whether this tilemap collides with the given game object.
|
||||
* @param {GameObject} object - Target object you want to check.
|
||||
* @return {bool} Return true if this collides with given object, otherwise return false.
|
||||
* @return {boolean} Return true if this collides with given object, otherwise return false.
|
||||
*/
|
||||
Phaser.Tilemap.prototype.collideGameObject = function (object) {
|
||||
|
||||
|
||||
@@ -21,13 +21,13 @@
|
||||
Phaser.TilemapLayer = function (parent, id, key, mapFormat, name, tileWidth, tileHeight) {
|
||||
|
||||
/**
|
||||
* @property {bool} exists - Controls whether update() and draw() are automatically called.
|
||||
* @property {boolean} exists - Controls whether update() and draw() are automatically called.
|
||||
* @default
|
||||
*/
|
||||
this.exists = true;
|
||||
|
||||
/**
|
||||
* @property {bool} visible - Controls whether draw() are automatically called.
|
||||
* @property {boolean} visible - Controls whether draw() are automatically called.
|
||||
* @default
|
||||
*/
|
||||
this.visible = true;
|
||||
@@ -444,7 +444,7 @@ Phaser.TilemapLayer.prototype = {
|
||||
* @param {number} [y] - Y position (in tiles) of block's left-top corner.
|
||||
* @param {number} [width] - width of block.
|
||||
* @param {number} [height] - height of block.
|
||||
* @param {bool} collisionOnly - Whethor or not ONLY return tiles which will collide (its allowCollisions value is not Collision.NONE).
|
||||
* @param {boolean} collisionOnly - Whethor or not ONLY return tiles which will collide (its allowCollisions value is not Collision.NONE).
|
||||
*/
|
||||
getTempBlock: function (x, y, width, height, collisionOnly) {
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ Phaser.TilemapRenderer.prototype = {
|
||||
* Render a tilemap to a canvas.
|
||||
* @method render
|
||||
* @param tilemap {Tilemap} The tilemap data to render.
|
||||
* @return {bool} Description.
|
||||
* @return {boolean} Description.
|
||||
*/
|
||||
render: function (tilemap) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user