mirror of
https://github.com/wassname/phaser.git
synced 2026-08-08 11:23:41 +08:00
Extracting the correct area from a layer, debug displaying it and preparing for collision.
This commit is contained in:
@@ -100,10 +100,36 @@ Phaser.Tile = function (tileset, index, x, y, width, height) {
|
||||
*/
|
||||
this.separateY = true;
|
||||
|
||||
/**
|
||||
* @property {boolean} collisionCallback - Tilemap collision callback.
|
||||
* @default
|
||||
*/
|
||||
this.collisionCallback = null;
|
||||
|
||||
/**
|
||||
* @property {boolean} collisionCallback - Tilemap collision callback.
|
||||
* @default
|
||||
*/
|
||||
this.collisionCallbackContext = this;
|
||||
|
||||
};
|
||||
|
||||
Phaser.Tile.prototype = {
|
||||
|
||||
/**
|
||||
* Set callback to be called when this tilemap collides.
|
||||
*
|
||||
* @method Phaser.Tilemap.prototype.setCollisionCallback
|
||||
* @param {Function} callback - Callback function.
|
||||
* @param {object} context - Callback will be called with this context.
|
||||
*/
|
||||
setCollisionCallback: function (callback, context) {
|
||||
|
||||
this.collisionCallbackContext = context;
|
||||
this.collisionCallback = callback;
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Clean up memory.
|
||||
* @method destroy
|
||||
|
||||
Reference in New Issue
Block a user