@nativescript/canvas-pixi 2.0.0-beta.9 → 2.0.0-webgpu.0

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/index.d.ts CHANGED
@@ -1,7 +1,3 @@
1
1
  import * as Pixii from 'pixi.js';
2
- export declare class TNSPIXIApplication extends Pixii.Application {
3
- constructor({ canvas, ...props }: {
4
- [x: string]: any;
5
- canvas: any;
6
- });
7
- }
2
+ declare let PIXI: typeof Pixii;
3
+ export default PIXI;
package/index.js CHANGED
@@ -1,14 +1,44 @@
1
1
  require('@nativescript/canvas-polyfill');
2
2
  import * as Pixii from 'pixi.js';
3
- export class TNSPIXIApplication extends Pixii.Application {
4
- constructor({ canvas, ...props }) {
5
- global.PIXI = global.window.PIXI = global.PIXI || Pixii;
3
+ import { Screen } from '@nativescript/core';
4
+ let PIXI = Pixii;
5
+ // import * as filters from 'pixi-filters';
6
+ class NSCPIXIApplication extends Pixii.Application {
7
+ constructor({ context, view, ...props }) {
8
+ let clientWidth = 300;
9
+ let clientHeight = 150;
10
+ if (context) {
11
+ clientWidth = context.canvas.clientWidth;
12
+ clientHeight = context.canvas.clientHeight;
13
+ }
14
+ if (view) {
15
+ clientWidth = view.clientWidth;
16
+ clientHeight = view.clientHeight;
17
+ }
18
+ if (!view) {
19
+ view = document.createElement('canvas');
20
+ view.nativeElement = context.canvas;
21
+ }
22
+ const width = props.width || clientWidth;
23
+ const height = props.height || clientHeight;
24
+ // PIXI.settings.RESOLUTION = 1;
6
25
  super({
7
- view: canvas,
8
- width: canvas.width || undefined,
9
- height: canvas.height || undefined,
10
26
  ...props,
27
+ resolution: Screen.mainScreen.scale,
28
+ view,
29
+ width,
30
+ height,
11
31
  });
32
+ console.log(this);
12
33
  }
13
34
  }
35
+ if (!(PIXI.Application instanceof NSCPIXIApplication)) {
36
+ PIXI.Assets.setPreferences({ preferWorkers: false });
37
+ PIXI = {
38
+ ...PIXI,
39
+ Application: NSCPIXIApplication,
40
+ };
41
+ }
42
+ global.PIXI = global.window.PIXI = global.PIXI || PIXI;
43
+ export default PIXI;
14
44
  //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/canvas-pixi/index.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,+BAA+B,CAAC,CAAC;AACzC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AAEjC,MAAM,OAAO,kBAAmB,SAAQ,KAAK,CAAC,WAAW;IACxD,YAAY,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE;QAC9B,MAAc,CAAC,IAAI,GAAI,MAAc,CAAC,MAAM,CAAC,IAAI,GAAI,MAAc,CAAC,IAAI,IAAI,KAAK,CAAC;QACnF,KAAK,CAAC;YACL,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,SAAS;YAChC,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,SAAS;YAClC,GAAG,KAAK;SACR,CAAC,CAAC;IACJ,CAAC;CACD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/canvas-pixi/index.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,+BAA+B,CAAC,CAAC;AACzC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,IAAI,IAAI,GAAG,KAAK,CAAC;AAEjB,2CAA2C;AAC3C,MAAM,kBAAmB,SAAQ,KAAK,CAAC,WAAW;IACjD,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE;QACtC,IAAI,WAAW,GAAG,GAAG,CAAC;QACtB,IAAI,YAAY,GAAG,GAAG,CAAC;QACvB,IAAI,OAAO,EAAE;YACZ,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC;YACzC,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC;SAC3C;QACD,IAAI,IAAI,EAAE;YACT,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;YAC/B,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;SACjC;QACD,IAAI,CAAC,IAAI,EAAE;YACV,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;YACxC,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;SACpC;QACD,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,WAAW,CAAC;QACzC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,YAAY,CAAC;QAE5C,gCAAgC;QAEhC,KAAK,CAAC;YACL,GAAG,KAAK;YACR,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,KAAK;YACnC,IAAI;YACJ,KAAK;YACL,MAAM;SACN,CAAC,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC;CACD;AAED,IAAI,CAAC,CAAC,IAAI,CAAC,WAAW,YAAY,kBAAkB,CAAC,EAAE;IACtD,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,CAAC;IACrD,IAAI,GAAG;QACN,GAAG,IAAI;QACP,WAAW,EAAE,kBAA2B;KACxC,CAAC;CACF;AAEA,MAAc,CAAC,IAAI,GAAI,MAAc,CAAC,MAAM,CAAC,IAAI,GAAI,MAAc,CAAC,IAAI,IAAI,IAAI,CAAC;AAElF,eAAe,IAAI,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nativescript/canvas-pixi",
3
- "version": "2.0.0-beta.9",
3
+ "version": "2.0.0-webgpu.0",
4
4
  "description": "Plugin for using pixi.js in NativeScript",
5
5
  "main": "index",
6
6
  "typings": "index.d.ts",
@@ -33,12 +33,16 @@
33
33
  "readmeFilename": "README.md",
34
34
  "bootstrapper": "nativescript-plugin-seed",
35
35
  "dependencies": {
36
- "@nativescript/canvas-polyfill": "alpha",
37
- "pixi.js": "^7.3.1"
36
+ "@nativescript/canvas-polyfill": "beta",
37
+ "pixi-filters": "~5.3.0",
38
+ "pixi.js": "~7.3.1",
39
+ "pixi.js-legacy": "~7.3.1",
40
+ "set-value": "4.1.0"
38
41
  },
39
42
  "peerDependencies": {
40
- "@nativescript/canvas": "2.0.0-beta.9",
41
- "@nativescript/canvas-media": "2.0.0-beta.9"
43
+ "@nativescript/canvas": "2.0.0-webgpu.0",
44
+ "@nativescript/canvas-media": "2.0.0-webgpu.0",
45
+ "@nativescript/canvas-svg": "2.0.0-webgpu.0"
42
46
  },
43
47
  "types": "./index.d.ts"
44
48
  }