like2d
    Preparing search index...

    Interface LikeBase

    The main modules and builtins of like.

    interface LikeBase {
        audio: Audio;
        canvas: Canvas;
        gamepad: Gamepad;
        gfx: Graphics;
        input: Input;
        keyboard: Keyboard;
        mouse: Mouse;
        timer: Timer;
        callOwnHandlers(event: LikeEvent): void;
        dispose(): void;
        start(): Promise<void>;
    }
    Index

    Methods

    • Used as the default like.handleEvent, simply dispatches an event into LIKE callbacks.

      Parameters

      Returns void

    • Only call this when you're done with LIKE. Everything will stop running, and probably break if you try to use it.

      Returns void

    • Start the game loop. Call this only once.

      Returns Promise<void>

      Promise that resolves when the engine is ready

    Properties

    audio: Audio

    Handle a pool of audio sources with global volume control and more.

    canvas: Canvas

    Get and set screen size, choosing between native and pixel perfect prescaling. Plus fullscreen control.

    gamepad: Gamepad

    Gamepad module: Map gamepads and check their buttons.

    Graphics module: LOVE-style rendering, plus a pseudo-synchronous way to load images.

    input: Input

    Bind inputs to actions that call like.actionpressed, or query them here also.

    keyboard: Keyboard

    Check if scancodes are down / pressed.

    mouse: Mouse

    Mouse module: Get a properly scaled mouse position, set capture and more.

    timer: Timer

    Misc. time functions, including sleeping the game. ZZZ