Skip to content

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. At 72 pixels it is wider than Button’s 56, since a thumb finds it by feel.

Its props are in Tap.

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

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