make<T>(comps?: CompList): GameObj<T>

Create a game object like add(), but not adding to the scene.

paramcomps- List of components to add to the game object.

const label = make([
    rect(100, 20),
]);

// Add a new text to the label
label.add([
    text("Hello, world!"),
]);

// Add game object to the scene
// Now it will render
add(label);

returnsThe created game object that contains all properties and methods each component offers.

sincev3000.1

kaplay logo

Misc

Layer