Small World Engine API Reference - v0.46.1
    Preparing search index...

    Class ImageLoader

    Loader for image assets.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    basePath: string = ""

    The base path for resource URLs.

    flipY: boolean = false

    Whether the image should be flipped vertically during loading.

    Methods

    • Dispatches an event.

      Parameters

      • type: string

        The event type.

      • eventData: Record<string, unknown> = {}

        Optional data associated with the event.

      Returns void

    • Loads a resource from the given URL.

      Parameters

      • url: string

        The relative URL to the resource.

      Returns Promise<ImageBitmap | HTMLImageElement>

      A promise resolving to the loaded resource.