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>

      Collection of options

    Returns Cubemap

Properties

_batchEnabled

_batchEnabled: number

Number of the texture batch, used by multi-texture renderers

member

{number}

_batchLocation

_batchLocation: number

Location inside texture batch, used by multi-texture renderers

member

{number}

Optional alphaMode

alphaMode?: ALPHA_MODES

How to treat premultiplied alpha, see {@link PIXI.ALPHA_MODES}.

member

{PIXI.ALPHA_MODES}

default

PIXI.ALPHA_MODES.UNPACK

Optional anisotropicLevel

anisotropicLevel?: number

Anisotropic filtering level of texture

member

{number}

default

PIXI.settings.ANISOTROPIC_LEVEL

cacheId

cacheId: string

Currently default cache ID.

member

{string}

cubemapFormat

cubemapFormat: CubemapFormat = CubemapFormat.ldr

The format for this cubemap.

destroyed

destroyed: boolean

Flag if BaseTexture has been destroyed.

member

{boolean}

readonly

dirtyId

dirtyId: number

Used by TextureSystem to only update texture to the GPU when needed. Please call update() to increment it.

readonly

Protected dirtyStyleId

dirtyStyleId: number

Used by TextureSystem to only update texture style when needed.

Optional format

format?: FORMATS

The pixel format of the texture

default

PIXI.FORMATS.RGBA

height

height: number

The height of the base texture set when the image has loaded

readonly

isPowerOfTwo

isPowerOfTwo: boolean

Whether or not the texture is a power of two, try to use power of two textures as much as you can

readonly
default

false

parentTextureArray

parentTextureArray: BaseTexture<Resource, IAutoDetectOptions>

Whether its a part of another texture, handled by ArrayResource or CubeResource

member

{PIXI.BaseTexture}

resolution

resolution: number

The resolution / device pixel ratio of the texture

readonly
default

PIXI.settings.RESOLUTION

resource

resource: CubemapResource

The resource used by this BaseTexture, there can only be one resource per BaseTexture, but textures can share resources.

member

{PIXI.Resource}

readonly

Optional target

target?: TARGETS

The target type

default

PIXI.TARGETS.TEXTURE_2D

textureCacheIds

textureCacheIds: string[]

The collection of alternative cache ids, since some BaseTextures can have more than one ID, short name and longer full URL

member

{Array}

readonly

Protected touched

touched: number

Used by automatic texture Garbage Collection, stores last GC tick when it was bound

Optional type

type?: TYPES

The type of resource data

default

PIXI.TYPES.UNSIGNED_BYTE

Readonly Protected uid

uid: number

Global unique identifier for this BaseTexture

valid

valid: boolean

Generally speaking means when resource is loaded.

readonly
member

{boolean}

width

width: number

The width of the base texture set when the image has loaded

readonly

Static _globalBatch

_globalBatch: number

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

Static prefixed

prefixed: string | boolean

Accessors

levels

  • get levels(): number

mipmap

  • get mipmap(): MIPMAP_MODES
  • set mipmap(value: MIPMAP_MODES): void
  • Mipmap mode of the texture, affects downscaled images

    default

    PIXI.settings.MIPMAP_TEXTURES

    Returns MIPMAP_MODES

  • Mipmap mode of the texture, affects downscaled images

    default

    PIXI.settings.MIPMAP_TEXTURES

    Parameters

    • value: MIPMAP_MODES

    Returns void

realHeight

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

    readonly

    Returns number

realWidth

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

    readonly

    Returns number

scaleMode

  • get scaleMode(): SCALE_MODES
  • set scaleMode(value: SCALE_MODES): void
  • The scale mode to apply when scaling this texture

    default

    PIXI.settings.SCALE_MODE

    Returns SCALE_MODES

  • The scale mode to apply when scaling this texture

    default

    PIXI.settings.SCALE_MODE

    Parameters

    • value: SCALE_MODES

    Returns void

wrapMode

  • get wrapMode(): WRAP_MODES
  • set wrapMode(value: WRAP_MODES): void
  • How the texture wraps

    default

    PIXI.settings.WRAP_MODE

    Returns WRAP_MODES

  • How the texture wraps

    default

    PIXI.settings.WRAP_MODE

    Parameters

    • value: WRAP_MODES

    Returns void

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

      Optionally set resolution

    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(desiredWidth: number, desiredHeight: number, resolution?: number): Cubemap
  • Changes w/h/resolution. Texture becomes valid if width and height are greater than zero.

    Parameters

    • desiredWidth: number

      Desired visual width

    • desiredHeight: number

      Desired visual height

    • Optional resolution: number

      Optionally set resolution

    Returns Cubemap

    • this

setStyle

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

    Parameters

    • Optional scaleMode: SCALE_MODES

      Pixi scalemode

    • Optional mipmap: MIPMAP_MODES

      enable mipmaps

    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.

    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 | string[], 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 | string[]

      The source to create base texture from.

    • Optional options: IBaseTextureOptions<RO>

      See {@link PIXI.BaseTexture}'s constructor for options.

    • 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.

    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>

      See {@link PIXI.BaseTexture}'s constructor for options. Default properties are different from the constructor's defaults.

    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.

    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