Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Cubemap<EventTypes, RO, EventTypes>

Cubemap which supports multiple user specified mipmaps.

Type parameters

  • EventTypes: string | symbol

  • RO

  • EventTypes: string | symbol

Hierarchy

  • BaseTexture<CubemapResource>
    • Cubemap

Index

Constructors

constructor

  • new Cubemap(resource?: CubemapResource | ImageSource | string | any, options?: IBaseTextureOptions<RO>): Cubemap
  • Parameters

    • Optional resource: CubemapResource | ImageSource | string | any
    • Optional options: IBaseTextureOptions<RO>

    Returns Cubemap

Properties

_batchEnabled

_batchEnabled: number

_batchLocation

_batchLocation: number

_glTextures

_glTextures: {}

Type declaration

  • [key: number]: GLTexture

Optional alphaMode

alphaMode: ALPHA_MODES

Optional anisotropicLevel

anisotropicLevel: undefined | number

cacheId

cacheId: string

destroyed

destroyed: boolean

dirtyId

dirtyId: number

dirtyStyleId

dirtyStyleId: number

Optional format

format: FORMATS

height

height: number

isPowerOfTwo

isPowerOfTwo: boolean

Optional mipmap

mipmap: MIPMAP_MODES

parentTextureArray

parentTextureArray: BaseTexture

resolution

resolution: number

resource

resource: CubemapResource

Optional scaleMode

scaleMode: SCALE_MODES

Optional target

target: TARGETS

textureCacheIds

textureCacheIds: Array<string>

touched

touched: number

Optional type

type: TYPES

uid

uid: number

valid

valid: boolean

width

width: number

Optional wrapMode

wrapMode: WRAP_MODES

Static _globalBatch

_globalBatch: number

Global number of the texture batch, used by multi-texture renderers

static
member

{number}

Static prefixed

prefixed: string | boolean

Accessors

levels

  • get levels(): number

realHeight

  • get realHeight(): number
  • Pixel height of the source of this texture

    readonly
    member

    {number}

    Returns number

realWidth

  • get realWidth(): number
  • Pixel width of the source of this texture

    readonly
    member

    {number}

    Returns number

Static faces

  • get faces(): []

Methods

Private _refreshPOT

  • _refreshPOT(): void
  • Refresh check for isPowerOfTwo texture based on size

    Returns void

addListener

  • addListener(event: EventTypes, fn: ListenerFn, context?: any): this

castToBaseTexture

  • castToBaseTexture(): BaseTexture
  • Utility function for BaseTexture|Texture cast

    Returns BaseTexture

destroy

  • destroy(): void
  • Destroys this base texture. The method stops if resource doesn't want this texture to be destroyed. Removes texture from all caches.

    Returns void

dispose

  • dispose(): void
  • Frees the texture from WebGL memory without destroying this texture object. This means you can still use the texture later which will upload it to GPU memory again.

    fires

    PIXI.BaseTexture#dispose

    Returns void

emit

  • emit(event: EventTypes, ...args: Array<any>): boolean
  • Calls each of the listeners registered for a given event.

    Parameters

    • event: EventTypes
    • Rest ...args: Array<any>

    Returns boolean

eventNames

  • eventNames(): Array<EventTypes>
  • Return an array listing the events for which the emitter has registered listeners.

    Returns Array<EventTypes>

listenerCount

  • listenerCount(event: EventTypes): number

listeners

off

  • off(event: EventTypes, fn?: EventEmitter.ListenerFn, context?: any, once?: undefined | false | true): this
  • Parameters

    • event: EventTypes
    • Optional fn: EventEmitter.ListenerFn
    • Optional context: any
    • Optional once: undefined | false | true

    Returns this

on

  • on(event: EventTypes, fn: ListenerFn, context?: any): this
  • Add a listener for a given event.

    Parameters

    • event: EventTypes
    • fn: ListenerFn
    • Optional context: any

    Returns this

Private onError

  • onError(event: ErrorEvent): void
  • Handle errors with resources.

    Parameters

    • event: ErrorEvent

      Error event emitted.

    Returns void

once

  • once(event: EventTypes, fn: ListenerFn, context?: any): this
  • Add a one-time listener for a given event.

    Parameters

    • event: EventTypes
    • fn: ListenerFn
    • Optional context: any

    Returns this

removeAllListeners

removeListener

  • removeListener(event: EventTypes, fn?: EventEmitter.ListenerFn, context?: any, once?: undefined | false | true): this
  • Remove the listeners of a given event.

    Parameters

    • event: EventTypes
    • Optional fn: EventEmitter.ListenerFn
    • Optional context: any
    • Optional once: undefined | false | true

    Returns this

setRealSize

  • setRealSize(realWidth: number, realHeight: number, resolution?: undefined | number): this
  • Sets real size of baseTexture, preserves current resolution.

    Parameters

    • realWidth: number

      Full rendered width

    • realHeight: number

      Full rendered height

    • Optional resolution: undefined | number

    Returns this

    this

setResolution

  • setResolution(resolution: number): this
  • Changes resolution

    Parameters

    • resolution: number

      res

    Returns this

    this

setResource

  • setResource(resource: CubemapResource): this
  • Sets the resource if it wasn't set. Throws error if resource already present

    Parameters

    • resource: CubemapResource

      that is managing this BaseTexture

    Returns this

    this

setSize

  • setSize(width: number, height: number, resolution?: undefined | number): this
  • Changes w/h/resolution. Texture becomes valid if width and height are greater than zero.

    Parameters

    • width: number

      Visual width

    • height: number

      Visual height

    • Optional resolution: undefined | number

    Returns this

    this

setStyle

  • setStyle(scaleMode?: SCALE_MODES, mipmap?: MIPMAP_MODES): this
  • Changes style options of BaseTexture

    Parameters

    • Optional scaleMode: SCALE_MODES
    • Optional mipmap: MIPMAP_MODES

    Returns this

    this

update

  • update(): void
  • Invalidates the object. Texture becomes valid if width and height are greater than zero.

    Returns void

Static addToCache

  • addToCache(baseTexture: BaseTexture, id: string): void
  • Adds a BaseTexture to the global BaseTextureCache. This cache is shared across the whole PIXI object.

    static

    Parameters

    • baseTexture: BaseTexture

      The BaseTexture to add to the cache.

    • id: string

      The id that the BaseTexture will be stored against.

    Returns void

Static from

  • from<R, RO>(source: ImageSource | string, options?: IBaseTextureOptions<RO>, strict?: undefined | false | true): BaseTexture<R>
  • Helper function that creates a base texture based on the source you provide. The source can be - image url, image element, canvas element. If the source is an image url or an image element and not in the base texture cache, it will be created and loaded.

    static

    Type parameters

    • R: Resource

    • RO

    Parameters

    • source: ImageSource | string

      The source to create base texture from.

    • Optional options: IBaseTextureOptions<RO>
    • Optional strict: undefined | false | true

    Returns BaseTexture<R>

    The new base texture.

Static fromBuffer

  • fromBuffer(buffer: Float32Array | Uint8Array, width: number, height: number, options?: IBaseTextureOptions): BaseTexture<BufferResource>
  • Create a new BaseTexture with a BufferResource from a Float32Array. RGBA values are floats from 0 to 1.

    static

    Parameters

    • buffer: Float32Array | Uint8Array

      The optional array to use, if no data is provided, a new Float32Array is created.

    • width: number

      Width of the resource

    • height: number

      Height of the resource

    • Optional options: IBaseTextureOptions

    Returns BaseTexture<BufferResource>

    The resulting new BaseTexture

Static fromColors

  • Creates a new cubemap from the specified colors.

    Parameters

    • posx: Color

      The color for positive x.

    • Default value negx: Color = posx

      The color for negative x.

    • Default value posy: Color = posx

      The color for positive y.

    • Default value negy: Color = posx

      The color for negative y.

    • Default value posz: Color = posx

      The color for positive z.

    • Default value negz: Color = posx

      The color for negative z.

    Returns Cubemap

Static fromFaces

Static removeFromCache

  • removeFromCache(baseTexture: string | BaseTexture): BaseTexture | null
  • Remove a BaseTexture from the global BaseTextureCache.

    static

    Parameters

    • baseTexture: string | BaseTexture

      id of a BaseTexture to be removed, or a BaseTexture instance itself.

    Returns BaseTexture | null

    The BaseTexture that was removed.

Generated using TypeDoc