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.0.1, it threw an error。
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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.0.1, it threw an error。
I'd like to know where I did wrong? Thanks !
Beta Was this translation helpful? Give feedback.
All reactions