summaryrefslogtreecommitdiff
path: root/src/components/GameCanvas.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/GameCanvas.tsx')
-rw-r--r--src/components/GameCanvas.tsx16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/components/GameCanvas.tsx b/src/components/GameCanvas.tsx
new file mode 100644
index 0000000..ea93c64
--- /dev/null
+++ b/src/components/GameCanvas.tsx
@@ -0,0 +1,16 @@
+import { useRef } from "react";
+
+export interface GameCanvasProps {
+ width: number;
+ height: number;
+}
+
+export const GameCanvas = ({ width, height }: GameCanvasProps) => {
+ const canvasRef = useRef<HTMLCanvasElement>(null);
+
+ return (
+ <div className="centered-game">
+ <canvas ref={canvasRef} width={width} height={height}></canvas>
+ </div>
+ );
+};