TQAGEMW7FKIQCPQOJN44XVUZJQFQYNGSYRVIYSXFYF36HU7YDMZQC
const appSize = BaseApplication.appSizeFromWindowSize(new Vector2(
this.config.originalWindowWidth, this.config.originalWindowHeight
));
this.originalAppWidth = appSize.x;
this.originalAppHeight = appSize.y;
// this.app = new Pixi.Application({
// width: this.originalAppWidth, // both are ignored - see resize() below
// height: this.originalAppHeight,
// antialias: true, // both about the same FPS, i get around 30 fps on 1600 x 900
// transparent: true, // true -> better fps?? https://github.com/pixijs/pixi.js/issues/5580
// resolution: window.devicePixelRatio || 1, // lower -> more FPS but uglier
// // resolution: 0.5,
// // resolution: 2,
// autoDensity: true,
// powerPreference: "low-power", // the only valid one for webgl
// backgroundColor: 0xffffff, // immaterial - we recommend setting color in backdrop graphics
// });
this.app = new Pixi.Application({
width: this.originalAppWidth, // both are ignored - see resize() below
height: this.originalAppHeight,
antialias: true, // both about the same FPS, i get around 30 fps on 1600 x 900
transparent: true, // true -> better fps?? https://github.com/pixijs/pixi.js/issues/5580
resolution: window.devicePixelRatio || 1, // lower -> more FPS but uglier
// resolution: 0.5,
// resolution: 2,
autoDensity: true,
powerPreference: "low-power", // the only valid one for webgl
backgroundColor: 0xffffff, // immaterial - we recommend setting color in backdrop graphics
});
// this.stage = this.app.stage;
// this.stage.sortableChildren = true;
this.stage = this.app.stage;
this.stage.sortableChildren = true;
// // this.fixedCameraStage = new Pixi.Sprite();
// // this.fixedCameraStage.zIndex = 1;
// // this.fixedCameraStage.sortableChildren = true;
// // this.stage.addChild(this.fixedCameraStage);
// this.fixedCameraStage = new Pixi.Sprite();
// this.fixedCameraStage.zIndex = 1;
// this.fixedCameraStage.sortableChildren = true;
// this.stage.addChild(this.fixedCameraStage);
// // this.actionStage = new Pixi.Sprite();
// // this.actionStage.zIndex = 0;
// // this.actionStage.sortableChildren = true;
// // this.stage.addChild(this.actionStage);
// this.actionStage = new Pixi.Sprite();
// this.actionStage.zIndex = 0;
// this.actionStage.sortableChildren = true;
// this.stage.addChild(this.actionStage);
// // this.backdropStage = new Pixi.Sprite();
// // this.backdropStage.zIndex = -1;
// // this.backdropStage.sortableChildren = true;
// // this.stage.addChild(this.backdropStage);
// this.backdropStage = new Pixi.Sprite();
// this.backdropStage.zIndex = -1;
// this.backdropStage.sortableChildren = true;
// this.stage.addChild(this.backdropStage);
// // this.keyboard = new KeyboardState();
// // this.app.ticker.add(() => {
// // this.keyboard.update();
// // })
// this.keyboard = new KeyboardState();
// this.app.ticker.add(() => {
// this.keyboard.update();
// })
// // this.fpsTracker = new FpsTracker();
// // this.app.ticker.add((delta) => {
// // // delta should be approximately equal to 1
// // this.fpsTracker.tick(delta);
// // })
let pointNodeTexture = new Lazy(() => generatePointNodeTexture(this.app.renderer));
// test
// createBunnyExample({ parent: this.actionStage, ticker: this.app.ticker, x: this.app.screen.width / 2, y: this.app.screen.height / 2 });
this.app.ticker.add((delta) => this.baseGameLoop(delta));
// // test
// // createBunnyExample({ parent: this.actionStage, ticker: this.app.ticker, x: this.app.screen.width / 2, y: this.app.screen.height / 2 });
// this.app.ticker.add((delta) => this.baseGameLoop(delta));