GameOverlay
Renders help and game results from an overlay controller.
import { GameOverlay } from 'filedom';
<GameOverlay
control={controls}
status={status}
width={1440}
height={900}
iconSize={96}
/>
Create controls with useGameControls or useGameOverlay. Render GameOverlay inside a StageProvider, after the play stage, so its files are created last and draw on top. The overlay runs its own Stage and park, and inherits the cover colour from the enclosing provider.
The overlay draws two Text blocks: the ? help
panel, shown only while status is playing, and the result banner, shown for
won, lost and draw. Their tiles own their files. On a win it also shows up
to four accent icons. The accents are its only pooled sprites and the only thing
its stage prebakes (gameOverlayPrebake(handle)); winEffect: 'none' turns
them off. The controller’s help and banner
TextStyle options set how each
text block is drawn. A help panel with a grid shape is anchored at the bottom
of the desktop instead of the center.
Props
controlGameOverlayController
Overlay configuration and help state.
GameOverlayControllerstatusGameResultStatus
playing, won, lost, or draw.
GameResultStatuswidthnumber
Desktop width; the overlay centers on it.
numberheightnumber
Desktop height; the overlay centers on it.
numbericonSizenumber
Finder icon size, used to scale the text and accents.
numberpark?StagePoint
Park override. Defaults to { x: width - iconSize, y: height - iconSize }.
StagePoint