PitchKit
API Reference@pitchkit/coreFunctions

goalPoint()

function goalPoint(
   layout, 
   frame, 
   y, 
   z, 
   inset?
): GoalPoint | undefined;

Defined in: packages/core/src/goal/layout.ts:117

A shot's goal-mouth coordinates, in frame's units, to pixels.

A point outside the view is pinned to its edge and marked clamped, the way a radar pins an off-scale value to its rim: a shot far wide still shows which side it went. A height below the ground is pinned to the ground. undefined for a missing or non-finite coordinate, which draws nothing rather than a shot at the origin.

inset draws any point within that many pixels of the sides or top that many pixels inside them, so a mark of that radius stays whole. It moves where the point is drawn, never whether it counts as clamped: that is decided against the view itself. A view with no size (a hidden container measures 0 x 0) has no room to inset into, and every point lands on its one pixel.

Parameters

ParameterTypeDefault value
layoutGoalLayoutundefined
frameGoalFrameundefined
ynumber | null | undefinedundefined
znumber | null | undefinedundefined
insetnumber0

Returns

GoalPoint | undefined

On this page