Class: BufferResource

PIXI.resources.BufferResource

Buffer resource with data of typed array.

new PIXI.resources.BufferResource (source, options)

Name Type Description
source Float32Array | Uint8Array | Uint32Array

Source buffer

options object

Options

Name Type Description
width number

Width of the texture

height number

Height of the texture

Extends

Members

_height number protected inherited

Internal height of the resource

_width number protected inherited

Internal width of the resource

data Float32Array | Uint8Array | Uint32Array

Source array Cannot be ClampedUint8Array because it cant be uploaded to WebGL

destroyed boolean readonly inherited

If resource has been destroyed

Default Value:
  • false

height number readonly inherited

The height of the resource.

internal boolean protected inherited

true if resource is created by BaseTexture useful for doing cleanup with BaseTexture destroy and not cleaning up resources that were created externally.

valid boolean readonly inherited

Has been validated

width number readonly inherited

The width of the resource.

Methods

PIXI.resources.BufferResource.test (source)boolean static

Used to auto-detect the type of resource.

Name Type Description
source *

The source object

Returns:
Type Description
boolean true if

bind (baseTexture) inherited

Bind to a parent BaseTexture

Name Type Description
baseTexture PIXI.BaseTexture

Parent texture

Call when destroying resource, unbind any BaseTexture object before calling this method, as reference counts are maintained internally.

dispose () protected inherited overrides

Clean up anything, this happens when destroying is ready.

load ()Promise.<void> protected inherited

This can be overridden to start preloading a resource or do any other prepare step.

Returns:
Type Description
Promise.<void> Handle the validate event

Trigger a resize event

style (renderer, baseTexture, glTexture)boolean inherited

Set the style, optional to override

Name Type Description
renderer PIXI.Renderer

yeah, renderer!

baseTexture PIXI.BaseTexture

the texture

glTexture PIXI.GLTexture

texture instance for this webgl context

Returns:
Type Description
boolean true is success

unbind (baseTexture) inherited

Unbind to a parent BaseTexture

Name Type Description
baseTexture PIXI.BaseTexture

Parent texture

Has been updated trigger event

upload (renderer, baseTexture, glTexture)boolean overrides

Upload the texture to the GPU.

Name Type Description
renderer PIXI.Renderer

Upload to the renderer

baseTexture PIXI.BaseTexture

Reference to parent texture

glTexture PIXI.GLTexture

glTexture

Returns:
Type Description
boolean true is success