Options
All
  • Public
  • Public/Protected
  • All
Menu

Cubemap which supports multiple user specified mipmaps.

Hierarchy

Index

Constructors

constructor

  • new Cubemap(resource?: any, options?: IBaseTextureOptions<IAutoDetectOptions>): Cubemap
  • Parameters

    • Optional resource: any
    • Optional options: IBaseTextureOptions<IAutoDetectOptions>

    Returns Cubemap

Properties

_batchEnabled

_batchEnabled: number

_batchLocation

_batchLocation: number

_glTextures

_glTextures: {}

Type declaration

  • [key: number]: GLTexture

Optional alphaMode

alphaMode?: ALPHA_MODES

Optional anisotropicLevel

anisotropicLevel?: 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<Resource, IAutoDetectOptions>

resolution

resolution: number

resource

resource: CubemapResource

Optional scaleMode

scaleMode?: SCALE_MODES

Optional target

target?: TARGETS

textureCacheIds

textureCacheIds: string[]

touched

touched: number

Optional type

type?: TYPES

Readonly 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(): ["posx", "negx", "posy", "negy", "posz", "negz"]

Methods

addListener

  • addListener(event: string | symbol, fn: ListenerFn, context?: any): Cubemap
  • Parameters

    • event: string | symbol
    • fn: ListenerFn
    • Optional context: any

    Returns Cubemap

castToBaseTexture

  • castToBaseTexture(): BaseTexture<Resource, IAutoDetectOptions>
  • Utility function for BaseTexture|Texture cast

    Returns BaseTexture<Resource, IAutoDetectOptions>

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: string | symbol, ...args: any[]): boolean
  • Calls each of the listeners registered for a given event.

    Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

eventNames

  • eventNames(): (string | symbol)[]
  • Return an array listing the events for which the emitter has registered listeners.

    Returns (string | symbol)[]

listenerCount

  • listenerCount(event: string | symbol): number
  • Return the number of listeners listening to a given event.

    Parameters

    • event: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): ListenerFn[]
  • Return the listeners registered for a given event.

    Parameters

    • event: string | symbol

    Returns ListenerFn[]

off

  • off(event: string | symbol, fn?: ListenerFn, context?: any, once?: boolean): Cubemap
  • Parameters

    • event: string | symbol
    • Optional fn: ListenerFn
    • Optional context: any
    • Optional once: boolean

    Returns Cubemap

on

  • on(event: string | symbol, fn: ListenerFn, context?: any): Cubemap
  • Add a listener for a given event.

    Parameters

    • event: string | symbol
    • fn: ListenerFn
    • Optional context: any

    Returns Cubemap

once

  • once(event: string | symbol, fn: ListenerFn, context?: any): Cubemap
  • Add a one-time listener for a given event.

    Parameters

    • event: string | symbol
    • fn: ListenerFn
    • Optional context: any

    Returns Cubemap

removeAllListeners

  • removeAllListeners(event?: string | symbol): Cubemap
  • Remove all listeners, or those of the specified event.

    Parameters

    • Optional event: string | symbol

    Returns Cubemap

removeListener

  • removeListener(event: string | symbol, fn?: ListenerFn, context?: any, once?: boolean): Cubemap
  • Remove the listeners of a given event.

    Parameters

    • event: string | symbol
    • Optional fn: ListenerFn
    • Optional context: any
    • Optional once: boolean

    Returns Cubemap

setRealSize

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

    Parameters

    • realWidth: number

      Full rendered width

    • realHeight: number

      Full rendered height

    • Optional resolution: number

    Returns Cubemap

    this

setResolution

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

    Parameters

    • resolution: number

      res

    Returns Cubemap

    this

setResource

  • Sets the resource if it wasn't set. Throws error if resource already present

    Parameters

    Returns Cubemap

    this

setSize

  • setSize(width: number, height: number, resolution?: number): Cubemap
  • 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: number

    Returns Cubemap

    this

setStyle

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

    Parameters

    • Optional scaleMode: SCALE_MODES
    • Optional mipmap: MIPMAP_MODES

    Returns Cubemap

    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<Resource, IAutoDetectOptions>, id: string): void
  • Adds a BaseTexture to the global BaseTextureCache. This cache is shared across the whole PIXI object.

    static

    Parameters

    • baseTexture: BaseTexture<Resource, IAutoDetectOptions>

      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: string | ImageSource, options?: IBaseTextureOptions<RO>, strict?: boolean): BaseTexture<R, IAutoDetectOptions>
  • 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<R> = Resource

    • RO = IAutoDetectOptions

    Parameters

    • source: string | ImageSource

      The source to create base texture from.

    • Optional options: IBaseTextureOptions<RO>
    • Optional strict: boolean

    Returns BaseTexture<R, IAutoDetectOptions>

    The new base texture.

Static fromBuffer

  • fromBuffer(buffer: Float32Array | Uint8Array, width: number, height: number, options?: IBaseTextureOptions<any>): BaseTexture<BufferResource, IAutoDetectOptions>
  • 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<any>

    Returns BaseTexture<BufferResource, IAutoDetectOptions>

    The resulting new BaseTexture

Static fromColors

  • Creates a new cubemap from the specified colors.

    Parameters

    • posx: Color

      The color for positive x.

    • negx: Color = posx

      The color for negative x.

    • posy: Color = posx

      The color for positive y.

    • negy: Color = posx

      The color for negative y.

    • posz: Color = posx

      The color for positive z.

    • negz: Color = posx

      The color for negative z.

    Returns Cubemap

Static fromFaces

Static removeFromCache

  • removeFromCache(baseTexture: string | BaseTexture<Resource, IAutoDetectOptions>): null | BaseTexture<Resource, IAutoDetectOptions>
  • Remove a BaseTexture from the global BaseTextureCache.

    static

    Parameters

    • baseTexture: string | BaseTexture<Resource, IAutoDetectOptions>

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

    Returns null | BaseTexture<Resource, IAutoDetectOptions>

    The BaseTexture that was removed.

Generated using TypeDoc