@nativescript/canvas-phaser 2.0.11 → 2.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/game.d.ts +0 -1
- package/game.js +0 -64
- package/game.js.map +0 -1
- package/index.d.ts +0 -1
- package/index.js +0 -2
- package/index.js.map +0 -1
- package/phaser.d.ts +0 -3
- package/phaser.js +0 -15
- package/phaser.js.map +0 -1
- package/tns-phaser.d.ts +0 -2
- package/tns-phaser.js +0 -3
- package/tns-phaser.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nativescript/canvas-phaser",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.14",
|
|
4
4
|
"description": "Build awesome 2D games with Phaser.js and NativeScript",
|
|
5
5
|
"main": "index",
|
|
6
6
|
"typings": "index.d.ts",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"bootstrapper": "@nativescript/plugin-seed",
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@nativescript/canvas-polyfill": "*",
|
|
37
|
-
"phaser": "~
|
|
37
|
+
"phaser": "~4.0.0"
|
|
38
38
|
},
|
|
39
39
|
"types": "./index.d.ts"
|
|
40
40
|
}
|
package/game.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const Game: (options: any) => any;
|
package/game.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import Phaser from './phaser';
|
|
2
|
-
export const Game = (options) => {
|
|
3
|
-
const title = options.title || 'tns-phaser-game';
|
|
4
|
-
// CANVAS
|
|
5
|
-
const AUTO = 0;
|
|
6
|
-
const CANVAS = 1;
|
|
7
|
-
const WEBGL = 2;
|
|
8
|
-
const type = options.type || WEBGL;
|
|
9
|
-
const customEnvironment = true;
|
|
10
|
-
const domCreateContainer = false;
|
|
11
|
-
const current = options;
|
|
12
|
-
const scene = options.scene || null;
|
|
13
|
-
const antialias = options.antialias || true;
|
|
14
|
-
const transparent = options.transparent || false;
|
|
15
|
-
const physics = options.physics || null;
|
|
16
|
-
const preventLoop = options.preventLoop;
|
|
17
|
-
const onRender = options.onRender;
|
|
18
|
-
const canvas = options.canvas;
|
|
19
|
-
let context;
|
|
20
|
-
let is2D = false;
|
|
21
|
-
switch (type) {
|
|
22
|
-
case 2:
|
|
23
|
-
context = canvas.getContext('webgl');
|
|
24
|
-
is2D = false;
|
|
25
|
-
break;
|
|
26
|
-
default:
|
|
27
|
-
context = canvas.getContext('2d');
|
|
28
|
-
is2D = true;
|
|
29
|
-
break;
|
|
30
|
-
}
|
|
31
|
-
global.document.readyState = 'complete';
|
|
32
|
-
let width;
|
|
33
|
-
let height;
|
|
34
|
-
width = options.width || canvas.width;
|
|
35
|
-
height = options.height || canvas.height;
|
|
36
|
-
delete current.domCreateContainer;
|
|
37
|
-
delete current.customEnvironment;
|
|
38
|
-
let config = {
|
|
39
|
-
width,
|
|
40
|
-
height,
|
|
41
|
-
//canvas,
|
|
42
|
-
context,
|
|
43
|
-
title,
|
|
44
|
-
type,
|
|
45
|
-
scene,
|
|
46
|
-
antialias,
|
|
47
|
-
transparent,
|
|
48
|
-
physics,
|
|
49
|
-
customEnvironment,
|
|
50
|
-
};
|
|
51
|
-
config = Object.assign(config, current);
|
|
52
|
-
const game = new Phaser.Game(config);
|
|
53
|
-
game.width = width;
|
|
54
|
-
game.height = height;
|
|
55
|
-
const render = function () {
|
|
56
|
-
requestAnimationFrame(render);
|
|
57
|
-
onRender && onRender();
|
|
58
|
-
};
|
|
59
|
-
if (!preventLoop) {
|
|
60
|
-
render();
|
|
61
|
-
}
|
|
62
|
-
return game;
|
|
63
|
-
};
|
|
64
|
-
//# sourceMappingURL=game.js.map
|
package/game.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"game.js","sourceRoot":"","sources":["../../../packages/canvas-phaser/game.ts"],"names":[],"mappings":"AAAA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AAK,CAAC;IACV,IAAI,MAAM,CAAC;IAEX,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC;IACtC,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC;IAGzC,OAAO,OAAO,CAAC,kBAAkB,CAAC;IAClC,OAAO,OAAO,CAAC,iBAAiB,CAAC;IAEjC,IAAI,MAAM,GAAG;QACZ,KAAK;QACL,MAAM;QACN,SAAS;QACT,OAAO;QACP,KAAK;QACL,IAAI;QACJ,KAAK;QACL,SAAS;QACT,WAAW;QACX,OAAO;QACP,iBAAiB;KACjB,CAAC;IAGF,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,MAAM,IAAI,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACrC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACrB,MAAM,MAAM,GAAG;QACd,qBAAqB,CAAC,MAAM,CAAC,CAAC;QAC9B,QAAQ,IAAI,QAAQ,EAAE,CAAC;IACxB,CAAC,CAAC;IACF,IAAI,CAAC,WAAW,EAAE,CAAC;QAClB,MAAM,EAAE,CAAC;IACV,CAAC;IAED,OAAO,IAAI,CAAC;AACb,CAAC,CAAA"}
|
package/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './tns-phaser';
|
package/index.js
DELETED
package/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/canvas-phaser/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
package/phaser.d.ts
DELETED
package/phaser.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import '@nativescript/canvas-polyfill';
|
|
2
|
-
function initPhaser() {
|
|
3
|
-
/* if ((global as any).Phaser) {
|
|
4
|
-
const version = parseFloat((global as any).Phaser.VERSION);
|
|
5
|
-
if (!Number.isNaN(version) && version < 3) {
|
|
6
|
-
(global as any).PIXI = (global as any).window.PIXI = undefined;
|
|
7
|
-
(global as any).p2 = (global as any).window.p2 = undefined;
|
|
8
|
-
(global as any).window.Phaser = (global as any).Phaser = undefined;
|
|
9
|
-
}
|
|
10
|
-
}*/
|
|
11
|
-
global.window.Phaser = global.Phaser = global.Phaser || require('phaser');
|
|
12
|
-
return global.Phaser;
|
|
13
|
-
}
|
|
14
|
-
export default initPhaser();
|
|
15
|
-
//# sourceMappingURL=phaser.js.map
|
package/phaser.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"phaser.js","sourceRoot":"","sources":["../../../packages/canvas-phaser/phaser.ts"],"names":[],"mappings":"AAAA,OAAO,+BAA+B,CAAC;AAEvC,SAAS,UAAU;IAClB;;;;;;;KAOI;IACH,MAAc,CAAC,MAAM,CAAC,MAAM,GAAI,MAAc,CAAC,MAAM,GAAI,MAAc,CAAC,MAAM,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;IACrG,OAAQ,MAAc,CAAC,MAAM,CAAC;AAC/B,CAAC;AAED,eAAe,UAAU,EAAE,CAAC"}
|
package/tns-phaser.d.ts
DELETED
package/tns-phaser.js
DELETED
package/tns-phaser.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tns-phaser.js","sourceRoot":"","sources":["../../../packages/canvas-phaser/tns-phaser.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
|