Function

offscreen

(opt?: OffScreenCompOpt): OffScreenComp

Control the behavior of object when it goes out of view.

param opt- Options for the offscreen component. See

add([
    pos(player.pos),
    sprite("bullet"),
    offscreen({ destroy: true }),
    "projectile",
]);

returns The offscreen comp.

since v2000.2

group Components

kaplay logo

Layer

Miscalenous