-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: c2d to webgl drawing chore: replace image asset lib
- Loading branch information
Showing
180 changed files
with
10,401 additions
and
9,647 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,48 @@ | ||
require('@nativescript/canvas-polyfill'); | ||
import * as Pixii from 'pixi.js'; | ||
|
||
export class TNSPIXIApplication extends Pixii.Application { | ||
constructor({ canvas, ...props }) { | ||
(global as any).PIXI = (global as any).window.PIXI = (global as any).PIXI || Pixii; | ||
let PIXI = Pixii; | ||
import {Screen} from '@nativescript/core'; | ||
|
||
// import * as filters from 'pixi-filters'; | ||
// PIXI.filters = { ...(PIXI.filters || {}), ...filters }; | ||
|
||
|
||
(global as any).PIXI = (global as any).window.PIXI = (global as any).PIXI || PIXI; | ||
|
||
class NSCPIXIApplication extends Pixii.Application { | ||
constructor({ context, view, ...props }) { | ||
let clientWidth = 300; | ||
let clientHeight = 150; | ||
if (context) { | ||
clientWidth = context.canvas.clientWidth; | ||
clientHeight = context.canvas.clientHeight; | ||
} | ||
if (view) { | ||
clientWidth = view.clientWidth; | ||
clientHeight = view.clientHeight; | ||
} | ||
const width = props.width || clientWidth; | ||
const height = props.height || clientHeight; | ||
|
||
|
||
super({ | ||
view: canvas, | ||
width: canvas.width || undefined, | ||
height: canvas.height || undefined, | ||
...props, | ||
resolution: Screen.mainScreen.scale, | ||
context, | ||
view, | ||
width, | ||
height | ||
}); | ||
} | ||
} | ||
|
||
if (!(PIXI.Application instanceof NSCPIXIApplication)) { | ||
PIXI.Assets.setPreferences({ preferWorkers: false }); | ||
PIXI = { | ||
...PIXI, | ||
Application: NSCPIXIApplication as never, | ||
}; | ||
} | ||
|
||
export default PIXI; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.