gameforge - v0.1.12
    Preparing search index...

    Class ResourceAbstract

    Base resource class for textures that manages validation and uploading, depending on its type.

    Uploading of a base texture to the GPU is required.

    PIXI

    Hierarchy (View Summary)

    Index

    Constructors

    • Parameters

      • Optionalwidth: number

        Width of the resource

      • Optionalheight: number

        Height of the resource

      Returns Resource

    Properties

    _height: number

    Internal height of the resource.

    _width: number

    Internal width of the resource.

    destroyed: boolean

    If resource has been destroyed.

    false
    
    internal: boolean

    true if resource is created by BaseTexture useful for doing cleanup with BaseTexture destroy and not cleaning up resources that were created externally.

    src: string

    The url of the resource

    Accessors

    • get height(): number

      The height of the resource.

      Returns number

    • get valid(): boolean

      Has been validated

      Returns boolean

    • get width(): number

      The width of the resource.

      Returns number

    Methods

    • Bind to a parent BaseTexture

      Parameters

      Returns void

    • Call when destroying resource, unbind any BaseTexture object before calling this method, as reference counts are maintained internally.

      Returns void

    • Clean up anything, this happens when destroying is ready.

      Returns void

    • Protected

      This can be overridden to start preloading a resource or do any other prepare step.

      Returns Promise<Resource>

      Handle the validate event

    • Trigger a resize event

      Parameters

      • width: number

        X dimension

      • height: number

        Y dimension

      Returns void

    • Set the style, optional to override

      Parameters

      Returns boolean

      • true is success
    • Unbind to a parent BaseTexture

      Parameters

      Returns void

    • Has been updated trigger event.

      Returns void

    • Uploads the texture or returns false if it cant for some reason. Override this.

      Parameters

      Returns boolean

      • true is success
    • Abstract, used to auto-detect resource type.

      Parameters

      • _source: unknown

        The source object

      • Optional_extension: string

        The extension of source, if set

      Returns boolean