Function autoDetectResource

  • Create a resource element from a single source element. This auto-detects which type of resource to create. All resources that are auto-detectable must have a static test method and a constructor with the arguments (source, options?). Currently, the supported resources for auto-detection include:

    • PIXI.ImageResource
    • PIXI.CanvasResource
    • PIXI.VideoResource
    • PIXI.SVGResource
    • PIXI.BufferResource

    Type Parameters

    Parameters

    • source: unknown

      Resource source, this can be the URL to the resource, a typed-array (for BufferResource), HTMLVideoElement, SVG data-uri or any other resource that can be auto-detected. If not resource is detected, it's assumed to be an ImageResource.

    • Optional options: RO

      Pass-through options to use for Resource

    Returns R

    The created resource.

    Static

    Memberof

    PIXI

    Function

    autoDetectResource

Generated using TypeDoc