diff options
author | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2024-03-01 16:31:27 -0700 |
---|---|---|
committer | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2024-03-01 16:31:27 -0700 |
commit | 5148ee2063846d37f9152a9dfa64fcd40cc0454b (patch) | |
tree | ba19032f6296c97e9dd8ce91253886bf24d5b441 /src/components/GameCanvas.tsx | |
parent | 17e95224a083ccd9e522f8712bb10846a2dada8a (diff) | |
download | the-abstraction-engine-5148ee2063846d37f9152a9dfa64fcd40cc0454b.tar.gz the-abstraction-engine-5148ee2063846d37f9152a9dfa64fcd40cc0454b.zip |
get something on the screen
Diffstat (limited to 'src/components/GameCanvas.tsx')
-rw-r--r-- | src/components/GameCanvas.tsx | 16 |
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> + ); +}; |