mirror of
https://github.com/wassname/phaser.git
synced 2026-07-27 11:25:30 +08:00
Fixed issue with CocoonJS detection in Device.
Fixed docs issue in Tilemap. Created landscape pointer test, confirmed working fine (issue #276)
This commit is contained in:
@@ -414,7 +414,7 @@ Phaser.Device.prototype = {
|
||||
*/
|
||||
_checkFeatures: function () {
|
||||
|
||||
this.canvas = !!window['CanvasRenderingContext2D'] || this.iscocoonJS;
|
||||
this.canvas = !!window['CanvasRenderingContext2D'] || this.cocoonJS;
|
||||
|
||||
try {
|
||||
this.localStorage = !!localStorage.getItem;
|
||||
|
||||
@@ -998,11 +998,16 @@ Phaser.Tilemap.prototype = {
|
||||
* @method Phaser.Tilemap#getTileWorldXY
|
||||
* @param {number} x - X position to get the tile from (given in pixels)
|
||||
* @param {number} y - Y position to get the tile from (given in pixels)
|
||||
* @param {number} [tileWidth] - The width of the tiles. If not given the map default is used.
|
||||
* @param {number} [tileHeight] - The height of the tiles. If not given the map default is used.
|
||||
* @param {number|string|Phaser.TilemapLayer} [layer] - The layer to get the tile from.
|
||||
* @return {Phaser.Tile} The tile at the given coordinates.
|
||||
*/
|
||||
getTileWorldXY: function (x, y, tileWidth, tileHeight, layer) {
|
||||
|
||||
if (typeof tileWidth === 'undefined') { tileWidth = this.tileWidth; }
|
||||
if (typeof tileHeight === 'undefined') { tileHeight = this.tileHeight; }
|
||||
|
||||
layer = this.getLayer(layer);
|
||||
|
||||
x = this.game.math.snapToFloor(x, tileWidth) / tileWidth;
|
||||
|
||||
@@ -293,6 +293,7 @@ Phaser.Utils.Debug.prototype = {
|
||||
this.line('World X: ' + pointer.worldX + " World Y: " + pointer.worldY);
|
||||
this.line('Screen X: ' + pointer.x + " Screen Y: " + pointer.y);
|
||||
this.line('Duration: ' + pointer.duration + " ms");
|
||||
this.line('is Down: ' + pointer.isDown + " is Up: " + pointer.isUp);
|
||||
this.stop();
|
||||
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user