@like2d/like
    Preparing search index...

    Interface ImageHandle

    An image that can be drawn using Graphics.draw

    Unlike raw HTMLImageElement, there is no need to wait for it to load. If the image isn't loaded, it simply won't draw it at all.

    If you're planning on loading many large images, simply load these image handles beforehand so that they're ready.

    interface ImageHandle {
        path: string;
        ready: Promise<void>;
        getElement(): HTMLImageElement;
        isReady(): boolean;
        get size(): Vector2 | undefined;
    }
    Index

    Accessors

    Methods

    Properties

    Accessors

    Methods

    • Escape hatch:

      Yes, you can get the underlying image. No, it's not stable in the case we ever switch to webGL.

      Returns HTMLImageElement

    Properties

    path: string
    ready: Promise<void>