jetlag2d
    Preparing search index...

    Class ImageLibraryService

    ImageService provides a library of image objects that can be used at any time.

    Index
    imageLoadingProgress: number = 2

    Track the progress of image loading, on a scale from 0 to 1, where 1 means "100% loaded". "2" means post-loading steps are also complete.

    • Get an image that has been loaded by the renderer, returning it as a raw Pixi Texture

      Parameters

      • imgName: string

        The name of the image to load

        NB: This returns the shared, cached Texture. If you want to modify it, clone it first, or every other sprite using this image will see the change too.

      Returns Texture<TextureSource<any>>

      A Texture built from the image

    • Load images into Pixi, so that we can be sure they are available before Pixi tries to use the images to make sprites

      Parameters

      • names: string[]

        An array of image names

      • prefix: string

        A prefix to append to each image name that needs to be loaded

      Returns Promise<void>