Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CubeMipmapTexture

Cubemap texture which supports multiple user specified mipmaps.

Hierarchy

  • BaseTexture
    • CubeMipmapTexture

Index

Constructors

constructor

  • new CubeMipmapTexture(resource?: Resource | string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, options?: undefined | { alphaMode?: PIXI.ALPHA_MODES; anisotropicLevel?: undefined | number; format?: PIXI.FORMATS; height?: undefined | number; mipmap?: PIXI.MIPMAP_MODES; resolution?: undefined | number; resourceOptions?: any; scaleMode?: PIXI.SCALE_MODES; target?: PIXI.TARGETS; type?: PIXI.TYPES; width?: undefined | number; wrapMode?: PIXI.WRAP_MODES }): CubeMipmapTexture
  • Parameters

    • Optional resource: Resource | string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement
    • Optional options: undefined | { alphaMode?: PIXI.ALPHA_MODES; anisotropicLevel?: undefined | number; format?: PIXI.FORMATS; height?: undefined | number; mipmap?: PIXI.MIPMAP_MODES; resolution?: undefined | number; resourceOptions?: any; scaleMode?: PIXI.SCALE_MODES; target?: PIXI.TARGETS; type?: PIXI.TYPES; width?: undefined | number; wrapMode?: PIXI.WRAP_MODES }

    Returns CubeMipmapTexture

Properties

_batchEnabled

_batchEnabled: number

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

member

{number} PIXI.BaseTexture#_batchEnabled

_batchLocation

_batchLocation: number

Location inside texture batch, used by multi-texture renderers

member

{number} PIXI.BaseTexture#_batchLocation

alphaMode

alphaMode: ALPHA_MODES

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

member

{PIXI.ALPHA_MODES} PIXI.BaseTexture#alphaMode

default

PIXI.ALPHA_MODES.UNPACK

anisotropicLevel

anisotropicLevel: number

Anisotropic filtering level of texture

member

{number} PIXI.BaseTexture#anisotropicLevel

default

PIXI.settings.ANISOTROPIC_LEVEL

cacheId

cacheId: string

Currently default cache ID.

member

{string} PIXI.BaseTexture#cacheId

destroyed

destroyed: boolean

Flag if BaseTexture has been destroyed.

member

{boolean} PIXI.BaseTexture#destroyed

readonly

dirtyId

dirtyId: number

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

readonly
member

{number} PIXI.BaseTexture#dirtyId

Protected dirtyStyleId

dirtyStyleId: number

Used by TextureSystem to only update texture style when needed.

member

{number} PIXI.BaseTexture#dirtyStyleId

format

format: FORMATS

The pixel format of the texture

member

{PIXI.FORMATS} PIXI.BaseTexture#format

default

PIXI.FORMATS.RGBA

height

height: number

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

readonly
member

{number} PIXI.BaseTexture#height

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
member

{boolean} PIXI.BaseTexture#isPowerOfTwo

default

false

mipmap

mipmap: MIPMAP_MODES

Mipmap mode of the texture, affects downscaled images

member

{PIXI.MIPMAP_MODES} PIXI.BaseTexture#mipmap

default

PIXI.settings.MIPMAP_TEXTURES

realHeight

realHeight: number

Pixel height of the source of this texture

readonly
member

{number}

realWidth

realWidth: number

Pixel width of the source of this texture

readonly
member

{number}

resolution

resolution: number

The resolution / device pixel ratio of the texture

member

{number} PIXI.BaseTexture#resolution

default

PIXI.settings.RESOLUTION

resource

resource: Resource

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

member

{PIXI.resources.Resource} PIXI.BaseTexture#resource

readonly

scaleMode

scaleMode: SCALE_MODES

The scale mode to apply when scaling this texture

member

{PIXI.SCALE_MODES} PIXI.BaseTexture#scaleMode

default

PIXI.settings.SCALE_MODE

target

target: TARGETS

The target type

member

{PIXI.TARGETS} PIXI.BaseTexture#target

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} PIXI.BaseTexture#textureCacheIds

readonly

Protected touched

touched: number

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

member

{number} PIXI.BaseTexture#touched

type

type: TYPES

The type of resource data

member

{PIXI.TYPES} PIXI.BaseTexture#type

default

PIXI.TYPES.UNSIGNED_BYTE

Protected uid

uid: string

Global unique identifier for this BaseTexture

member

{string} PIXI.BaseTexture#uid

valid

valid: boolean

Generally speaking means when resource is loaded.

readonly
member

{boolean} PIXI.BaseTexture#valid

width

width: number

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

readonly
member

{number} PIXI.BaseTexture#width

wrapMode

wrapMode: number

How the texture wraps

member

{number} PIXI.BaseTexture#wrapMode

Static _globalBatch

_globalBatch: number

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

static
member

{number}

Accessors

levels

  • get levels(): number

Static faces

  • get faces(): string[]

Methods

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

setRealSize

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

    Parameters

    • realWidth: number

      Full rendered width

    • realHeight: number

      Full rendered height

    • Optional resolution: undefined | number

    Returns BaseTexture

    this

setResolution

  • setResolution(resolution?: undefined | number): BaseTexture
  • Changes resolution

    Parameters

    • Optional resolution: undefined | number

    Returns BaseTexture

    this

setResource

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

    Parameters

    • resource: Resource

      that is managing this BaseTexture

    Returns BaseTexture

    this

setSize

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

    this

setStyle

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

    Parameters

    • Optional scaleMode: PIXI.SCALE_MODES
    • Optional mipmap: PIXI.MIPMAP_MODES

    Returns BaseTexture

    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(source: string | HTMLImageElement | HTMLCanvasElement | SVGElement | HTMLVideoElement, options?: any, strict?: undefined | false | true): BaseTexture
  • 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

    Parameters

    • source: string | HTMLImageElement | HTMLCanvasElement | SVGElement | HTMLVideoElement

      The source to create base texture from.

    • Optional options: any
    • Optional strict: undefined | false | true

    Returns BaseTexture

    The new base texture.

Static fromBuffer

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

    Returns BaseTexture

    The resulting new BaseTexture

Static fromSource

  • Creates a new cubemap texture from the specified source.

    Parameters

    • source: string[]

      The array of mipmap sources. The format of the mipmap source should be "cubemap_{{face}}.jpg". "{{face}}" will automatically be replaced with the faces (posx, negx, posy, negy, posz, negz).

    Returns CubeMipmapTexture

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