Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AbstractMultiResource

Resource that can manage several resource (items) inside. All resources need to have the same pixel size. Parent class for CubeResource and ArrayResource

memberof

PIXI

Hierarchy

Index

Constructors

constructor

Properties

Protected _height

_height: number

Private _load

_load: any

Protected _width

_width: number

baseTexture

destroyed

destroyed: boolean

internal

internal: boolean

itemDirtyIds

itemDirtyIds: number[]

items

Readonly length

length: number

Protected onError

onError: Runner

Protected onResize

onResize: Runner

Protected onUpdate

onUpdate: Runner

Accessors

height

  • get height(): number
  • The height of the resource.

    member

    {number}

    readonly

    Returns number

valid

  • get valid(): boolean
  • Has been validated

    readonly
    member

    {boolean}

    Returns boolean

width

  • get width(): number
  • The width of the resource.

    member

    {number}

    readonly

    Returns number

Methods

Abstract addBaseTextureAt

addResourceAt

  • Set a resource by ID

    Parameters

    • resource: Resource
    • index: number

      Zero-based index of resource to set

    Returns AbstractMultiResource

    Instance for chaining

bind

destroy

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

    Returns void

dispose

  • dispose(): void
  • Destroy this BaseImageResource

    override

    Returns void

Protected initFromArray

  • used from ArrayResource and CubeResource constructors

    Parameters

    • resources: any[]

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

    • Optional options: IAutoDetectOptions

    Returns void

load

  • Load all the resources simultaneously

    override

    Returns Promise<AbstractMultiResource>

    When load is resolved

resize

  • resize(width: number, height: number): void
  • Trigger a resize event

    Parameters

    • width: number

      X dimension

    • height: number

      Y dimension

    Returns void

style

unbind

update

  • update(): void
  • Has been updated trigger event

    Returns void

Abstract upload

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

    Parameters

    Returns boolean

    true is success

Static test

  • test(_source: unknown, _extension?: string): boolean
  • Abstract, used to auto-detect resource type

    static

    Parameters

    • _source: unknown
    • Optional _extension: string

    Returns boolean

Generated using TypeDoc