OffScreenComp:

The offscreen component.

offscreenDistance: number | undefined

The minimum distance that the object must be off the screen by to be considered "offscreen". If it is undefined, it means that the object will be considered to be offscreen when its bounding rectangle (defined by width and height) is not intersecting with the screen rectangle.

isOffScreen(): boolean

If object is currently out of view.

onExitScreen(action: ()=>void): KEventController

Register an event that runs when object goes out of view.

onEnterScreen(action: ()=>void): KEventController

Register an event that runs when object enters view.

kaplay logo

Misc

Layer