taking longer than usual.

skip to content
sometimes/ developers

developers / games / build your game

layouts & input

game.environment reports the available dimensions, theme and focus state so your interface can adapt to changes in the host window.

API 1 · SDK 1.0.2download reference

container and theme

game.environment contains dimensions, safeArea, keyboardInset, visibility, focus, connection, call state, theme tokens, reduced motion, text scale and language. changes trigger subscribe. the host handles desktop dividers and mobile call strips. use viewport or container queries.

input controls

DOM pointer and touch controls work normally. game.input.keyboard(handler) filters composition and modifiers; game.input.gamepads(handler) polls while focused. both return cleanup functions. release held inputs when focus changes and provide accessible alternatives.

React helpers

useGame subscribes to snapshots. Avatar and useProfile provide scoped pictures and average colors. Segmented, PlayerList and Scores cover settings, rosters, standings and podiums. import @sometimes/games/ui.css for base styles. custom renderers remain supported.