mirror of
https://github.com/wassname/phaser.git
synced 2026-08-16 11:25:21 +08:00
TilemapLayers now render tiles correctly, with our without debugging overlay. Collision working well across single and index ranges.
This commit is contained in:
+70
-23
@@ -224,6 +224,12 @@ Phaser.Device = function () {
|
||||
*/
|
||||
this.webApp = false;
|
||||
|
||||
/**
|
||||
* @property {boolean} silk - Set to true if running in the Silk browser (as used on the Amazon Kindle)
|
||||
* @default
|
||||
*/
|
||||
this.silk = false;
|
||||
|
||||
// Audio
|
||||
|
||||
/**
|
||||
@@ -328,21 +334,33 @@ Phaser.Device.prototype = {
|
||||
|
||||
var ua = navigator.userAgent;
|
||||
|
||||
if (/Android/.test(ua)) {
|
||||
if (/Android/.test(ua))
|
||||
{
|
||||
this.android = true;
|
||||
} else if (/CrOS/.test(ua)) {
|
||||
}
|
||||
else if (/CrOS/.test(ua))
|
||||
{
|
||||
this.chromeOS = true;
|
||||
} else if (/iP[ao]d|iPhone/i.test(ua)) {
|
||||
}
|
||||
else if (/iP[ao]d|iPhone/i.test(ua))
|
||||
{
|
||||
this.iOS = true;
|
||||
} else if (/Linux/.test(ua)) {
|
||||
}
|
||||
else if (/Linux/.test(ua))
|
||||
{
|
||||
this.linux = true;
|
||||
} else if (/Mac OS/.test(ua)) {
|
||||
}
|
||||
else if (/Mac OS/.test(ua))
|
||||
{
|
||||
this.macOS = true;
|
||||
} else if (/Windows/.test(ua)) {
|
||||
}
|
||||
else if (/Windows/.test(ua))
|
||||
{
|
||||
this.windows = true;
|
||||
}
|
||||
|
||||
if (this.windows || this.macOS || this.linux) {
|
||||
if (this.windows || this.macOS || (this.linux && this.silk === false))
|
||||
{
|
||||
this.desktop = true;
|
||||
}
|
||||
|
||||
@@ -378,11 +396,13 @@ Phaser.Device.prototype = {
|
||||
|
||||
this.worker = !!window['Worker'];
|
||||
|
||||
if ('ontouchstart' in document.documentElement || (window.navigator.maxTouchPoints && window.navigator.maxTouchPoints > 1)) {
|
||||
if ('ontouchstart' in document.documentElement || (window.navigator.maxTouchPoints && window.navigator.maxTouchPoints > 1))
|
||||
{
|
||||
this.touch = true;
|
||||
}
|
||||
|
||||
if (window.navigator.msPointerEnabled || window.navigator.pointerEnabled) {
|
||||
if (window.navigator.msPointerEnabled || window.navigator.pointerEnabled)
|
||||
{
|
||||
this.mspointer = true;
|
||||
}
|
||||
|
||||
@@ -399,37 +419,62 @@ Phaser.Device.prototype = {
|
||||
|
||||
var ua = navigator.userAgent;
|
||||
|
||||
if (/Arora/.test(ua)) {
|
||||
if (/Arora/.test(ua))
|
||||
{
|
||||
this.arora = true;
|
||||
} else if (/Chrome/.test(ua)) {
|
||||
}
|
||||
else if (/Chrome/.test(ua))
|
||||
{
|
||||
this.chrome = true;
|
||||
} else if (/Epiphany/.test(ua)) {
|
||||
}
|
||||
else if (/Epiphany/.test(ua))
|
||||
{
|
||||
this.epiphany = true;
|
||||
} else if (/Firefox/.test(ua)) {
|
||||
}
|
||||
else if (/Firefox/.test(ua))
|
||||
{
|
||||
this.firefox = true;
|
||||
} else if (/Mobile Safari/.test(ua)) {
|
||||
}
|
||||
else if (/Mobile Safari/.test(ua))
|
||||
{
|
||||
this.mobileSafari = true;
|
||||
} else if (/MSIE (\d+\.\d+);/.test(ua)) {
|
||||
}
|
||||
else if (/MSIE (\d+\.\d+);/.test(ua))
|
||||
{
|
||||
this.ie = true;
|
||||
this.ieVersion = parseInt(RegExp.$1, 10);
|
||||
} else if (/Midori/.test(ua)) {
|
||||
}
|
||||
else if (/Midori/.test(ua))
|
||||
{
|
||||
this.midori = true;
|
||||
} else if (/Opera/.test(ua)) {
|
||||
}
|
||||
else if (/Opera/.test(ua))
|
||||
{
|
||||
this.opera = true;
|
||||
} else if (/Safari/.test(ua)) {
|
||||
}
|
||||
else if (/Safari/.test(ua))
|
||||
{
|
||||
this.safari = true;
|
||||
} else if (/Trident\/(\d+\.\d+);/.test(ua)) {
|
||||
}
|
||||
else if (/Silk/.test(ua))
|
||||
{
|
||||
this.silk = true;
|
||||
}
|
||||
else if (/Trident\/(\d+\.\d+);/.test(ua))
|
||||
{
|
||||
this.ie = true;
|
||||
this.trident = true;
|
||||
this.tridentVersion = parseInt(RegExp.$1, 10);
|
||||
}
|
||||
|
||||
// WebApp mode in iOS
|
||||
if (navigator['standalone']) {
|
||||
if (navigator['standalone'])
|
||||
{
|
||||
this.webApp = true;
|
||||
}
|
||||
|
||||
if (navigator['isCocoonJS']) {
|
||||
if (navigator['isCocoonJS'])
|
||||
{
|
||||
this.cocoonJS = true;
|
||||
}
|
||||
|
||||
@@ -534,8 +579,10 @@ Phaser.Device.prototype = {
|
||||
// Add it to the body to get the computed style.
|
||||
document.body.insertBefore(el, null);
|
||||
|
||||
for (var t in transforms) {
|
||||
if (el.style[t] !== undefined) {
|
||||
for (var t in transforms)
|
||||
{
|
||||
if (el.style[t] !== undefined)
|
||||
{
|
||||
el.style[t] = "translate3d(1px,1px,1px)";
|
||||
has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user