Function

pos

(x: number, y: number): PosComp

Set the position of a Game Object.

param x- The x position to set.

param y- The y position to set.

// This game object will draw a "bean" sprite at (100, 200)
add([
    pos(100, 200),
    sprite("bean"),
]);

returns The position comp.

since v2000.0

group Components

Function

pos

(xy: number): PosComp
Function

pos

(p: Vec2): PosComp
Function

pos

(): PosComp
kaplay logo

Layer

Miscalenous