This repository has been archived on 2020-09-30. You can view files and clone it, but cannot push or open issues or pull requests.
odyfive/src/index.tsx

27 lines
656 B
TypeScript

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")
);