import * as React from "react";
import * as PIXI from "pixi.js";
import ReactDOM from "react-dom";
import { Stage, useApp } from "@inlet/react-pixi";
import MenuBackground from "./game/MenuBackground";

PIXI.settings.SCALE_MODE = PIXI.SCALE_MODES.NEAREST;

const mounted = (app: PIXI.Application) => {
  window.addEventListener("resize", () => {
    app.queueResize();
  });
  app.queueResize();
};

ReactDOM.render(
  <React.Fragment>
    <Stage options={{ resolution: 1, resizeTo: window }} onMount={mounted}>
      <MenuBackground />
    </Stage>
    <div id="ui">
      <p>Hello!</p>
    </div>
  </React.Fragment>,
  document.getElementById("app")
);
