Skip to content

1681-engine / index / inView

Function: inView() ​

ts
function inView(
   cam, 
   x, 
   y, 
   margin
): boolean;

Defined in: src/fx/viewCull.ts:14

Whether the world point (x, y) lies within margin world pixels of the screen. Effects use it to skip painting what nobody can see. A camera that has no size yet (a tool's fake stage, before the first resize) counts everything in.

Parameters ​

ParameterType
camCameraLike
xnumber
ynumber
marginnumber

Returns ​

boolean

Released under the MIT License.