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

CanvasTapOptions

What useCanvasTap reads. It reads the latest each render passes, so inline functions are fine.

Type Parameter
Target
Property Type Description
findTarget (ray) => Target | null | undefined The game’s target under the ray: by the game’s own layout, by findEntityUnderRay, or any other way. It runs once a tap.
maxHoldSeconds? number Seconds the press may be held; 0.4 unless given.
maxTravelPixels? number Screen pixels the press may reach from where it went down, at any moment of the press; the map camera’s click slop, 4, unless given, so a press the map camera pans never taps. In pixels, not the metres every other distance in the engine is in.
onTap (context) => void Runs on each tap, a tap on nothing included, so a game can clear a selection there.