You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to extends PIXI.Application to create a game's main class, but when I run the code, browser threw an error :Uncaught (in promise) TypeError: Class constructor _Application cannot be invoked without 'new'.
The code of main class:
export class Game extends PIXI.Application {
constructor(options) {
super(options)
}
}
The code to create game instance:
window.onload = async function () {
const dom = document.getElementById('my_game');
const options = {width: 1280, height: 720, backgroundColor: 0x111111, sharedTicker: true, transparent: false};
const game = new Game();
await game.init(options);
dom .appendChild(game.canvas);
};
I do samething in pixi.js v6.5.4, it works OK,but in v8.1.0, it threw an error.
Try for Container, similar error occurs: Uncaught (in promise) TypeError: Class constructor Container cannot be invoked without 'new'.
The JS code is ES6, and is compiled into ES5.
Expected Behavior
All class could be extended.
Steps to Reproduce
Please run the code.
Environment
pixi.js version: v8.1.0
Browser & Version: Chrome 123.0.6312.124
OS & Version: Windows 11
Running Example: **
Possible Solution
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered:
Current Behavior
I tried to extends PIXI.Application to create a game's main class, but when I run the code, browser threw an error :Uncaught (in promise) TypeError: Class constructor _Application cannot be invoked without 'new'.
The code of main class:
The code to create game instance:
I do samething in pixi.js v6.5.4, it works OK,but in v8.1.0, it threw an error.
Try for Container, similar error occurs: Uncaught (in promise) TypeError: Class constructor Container cannot be invoked without 'new'.
The JS code is ES6, and is compiled into ES5.
Expected Behavior
All class could be extended.
Steps to Reproduce
Please run the code.
Environment
pixi.js
version: v8.1.0Possible Solution
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: