Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CubemapResource

Hierarchy

  • CubeResource
    • CubemapResource

Index

Constructors

constructor

  • new CubemapResource(source: MipmapResourceArray, levels?: number): CubemapResource

Properties

Protected _height

_height: number

Internal height of the resource.

Protected _width

_width: number

Internal width of the resource.

baseTexture

baseTexture: BaseTexture<Resource, IAutoDetectOptions>

Bound baseTexture, there can only be one.

destroyed

destroyed: boolean

If resource has been destroyed.

readonly
default

false

internal

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

itemDirtyIds: number[]

Dirty IDs for each part.

readonly

items

items: ArrayFixed<BaseTexture<Resource, IAutoDetectOptions>, 6>

Readonly length

length: number

Number of elements in array.

levels

levels: number = 1

Protected linkBaseTexture

linkBaseTexture: boolean

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

src

src: string

The url of the resource

Static SIDES

SIDES: number

Number of texture sides to store for CubeResources.

Accessors

height

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

    readonly

    Returns number

valid

  • get valid(): boolean
  • Has been validated

    readonly

    Returns boolean

width

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

    readonly

    Returns number

Methods

addBaseTextureAt

  • addBaseTextureAt(baseTexture: BaseTexture<Resource, IAutoDetectOptions>, index: number, linkBaseTexture?: boolean): CubemapResource
  • Parameters

    • baseTexture: BaseTexture<Resource, IAutoDetectOptions>
    • index: number
    • Optional linkBaseTexture: boolean

    Returns CubemapResource

addResourceAt

  • Set a resource by ID

    Parameters

    • resource: Resource
    • index: number

      Zero-based index of resource to set

    Returns CubemapResource

    • Instance for chaining

bind

  • bind(baseTexture: BaseTexture<Resource, IAutoDetectOptions>): void
  • Add binding.

    Parameters

    • baseTexture: BaseTexture<Resource, IAutoDetectOptions>

      parent base texture

    Returns void

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.

    Returns void

Protected initFromArray

  • initFromArray(resources: any[], options?: IAutoDetectOptions): void
  • 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

      Detect options for resources

    Returns void

load

  • Load all the resources simultaneously

    Returns Promise<CubemapResource>

    • 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

  • style(renderer: Renderer): boolean

unbind

  • unbind(baseTexture: BaseTexture<Resource, IAutoDetectOptions>): void
  • Unset the parent base texture.

    Parameters

    • baseTexture: BaseTexture<Resource, IAutoDetectOptions>

    Returns void

update

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

    Returns void

upload

  • upload(renderer: Renderer, _baseTexture: BaseTexture<Resource, IAutoDetectOptions>, glTexture: GLTexture): boolean
  • Upload the resource

    Parameters

    • renderer: Renderer
    • _baseTexture: BaseTexture<Resource, IAutoDetectOptions>
    • glTexture: GLTexture

    Returns boolean

    true is success

Static test

  • test(source: unknown): source is ArrayFixed<string | Resource, 6>
  • 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

Generated using TypeDoc