gameforge - v0.1.12
    Preparing search index...

    Class CubeResource

    Resource for a CubeTexture which contains six resources.

    PIXI

    Hierarchy (View Summary)

    Index

    Constructors

    • Parameters

      • Optionalsource: ArrayFixed<string | Resource, 6>

        Collection of URLs or resources to use as the sides of the cube.

      • Optionaloptions: ICubeResourceOptions

        ImageResource options

        Constructor options for CubeResource.

        • OptionalautoLoad?: boolean

          Whether to auto-load resources

        • height: number
        • OptionallinkBaseTexture?: boolean

          In case BaseTextures are supplied, whether to copy them or use.

        • width: number

      Returns CubeResource

    Properties

    _height: number

    Internal height of the resource.

    _width: number

    Internal width of the resource.

    baseTexture: BaseTexture

    Bound baseTexture, there can only be one.

    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.

    itemDirtyIds: number[]

    Dirty IDs for each part.

    Collection of partial baseTextures that correspond to resources.

    length: number

    Number of elements in array.

    linkBaseTexture: boolean

    In case BaseTextures are supplied, whether to use same resource or bind baseTexture itself.

    src: string

    The url of the resource

    SIDES: number

    Number of texture sides to store for CubeResources.

    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

    • Set a baseTexture by ID

      Parameters

      • baseTexture: BaseTexture
      • index: number

        Zero-based index of resource to set

      • OptionallinkBaseTexture: boolean

      Returns this

      • Instance for chaining
    • Set a resource by ID

      Parameters

      • resource: Resource
      • index: number

        Zero-based index of resource to set

      Returns this

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

      Returns void

    • Destroy this BaseImageResource.

      Returns void

    • Used from ArrayResource and CubeResource constructors.

      Parameters

      • resources: any[]

        Can be resources, image elements, canvas, etc. , length should be same as constructor length

      • Optionaloptions: IAutoDetectOptions

        Detect options for resources

      Returns void

    • Load all the resources simultaneously

      Returns Promise<CubeResource>

      • When load is resolved
    • 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
    • Unset the parent base texture.

      Parameters

      Returns void

    • Has been updated trigger event.

      Returns void

    • Used to auto-detect the type of resource.

      Parameters

      • source: unknown

        The source object

      Returns source is ArrayFixed<string | Resource, 6>

      true if source is an array of 6 elements