Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

Tap

<Tap onTap> is the action button beside the Joystick: jump, attack, interact. It fires on the press, not on the release, because an action is timed against the world and a release lands late. onRelease runs once as the finger lifts, slides off or the browser takes the touch, for a control held down, such as a sprint; <InputButtons /> draws one per binding that declares touch. At 72 pixels it is wider than Button’s 56, since a thumb finds it by feel.

Its props are in Tap. It stands in the screen’s bottom-right slot, beside the stick’s corner, for a coarse pointer only; slot moves it.

A keyboard or a screen reader activates it too, and fires it once.

import { Hud, Icon, Tap } from "@spawnite/engine";
export function JumpButton({ onJump }: { onJump: () => void }) {
return (
<Hud>
<Tap label="Jump" onTap={onJump}>
<Icon name="arrow-big-up" className="size-8" />
</Tap>
</Hud>
);
}