PIXI. BaseTexture

new BaseTexture(source, scaleMode)

A texture stores the information that represents an image. All textures have a base texture.

Parameters:
Name Type Description
source String

the source object (image or canvas)

scaleMode Number

See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values

Source - pixi/textures/BaseTexture.js, line 9

Members

<readonly> hasLoaded :Boolean

[read-only] Set to true once the base texture has loaded

Source - pixi/textures/BaseTexture.js, line 55

<readonly> height :Number

[read-only] The height of the base texture set when the image has loaded

Source - pixi/textures/BaseTexture.js, line 37

imageUrl :String

Source - pixi/textures/BaseTexture.js, line 132

premultipliedAlpha :Boolean

Controls if RGB channels should be pre-multiplied by Alpha (WebGL only)

Default Value:
  • true
Source - pixi/textures/BaseTexture.js, line 74

resolution :Number

The Resolution of the texture.

Source - pixi/textures/BaseTexture.js, line 20

scaleMode :Number

The scale mode to apply when scaling this texture

Default Value:
  • PIXI.scaleModes.LINEAR
Source - pixi/textures/BaseTexture.js, line 46

source :Image

The image source that is used to create the texture.

Source - pixi/textures/BaseTexture.js, line 64

<readonly> width :Number

[read-only] The width of the base texture set when the image has loaded

Source - pixi/textures/BaseTexture.js, line 28

Methods

<static> fromCanvas(canvas, scaleMode)

Helper function that creates a base texture from the given canvas element.

Parameters:
Name Type Description
canvas Canvas

The canvas element source of the texture

scaleMode Number

See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values

Returns:

BaseTexture

Source - pixi/textures/BaseTexture.js, line 270

<static> fromImage(imageUrl, crossorigin, scaleMode)

Helper function that creates a base texture from the given image url. If the image is not in the base texture cache it will be created and loaded.

Parameters:
Name Type Description
imageUrl String

The image url of the texture

crossorigin Boolean

-

scaleMode Number

See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values

Returns:

BaseTexture

Source - pixi/textures/BaseTexture.js, line 228

destroy()

Destroys this base texture

Source - pixi/textures/BaseTexture.js, line 151

dirty()

Sets all glTextures to be dirty.

Source - pixi/textures/BaseTexture.js, line 187

unloadFromGPU()

Removes the base texture from the GPU, useful for managing resources on the GPU. Atexture is still 100% usable and will simply be reuploaded if there is a sprite on screen that is using it.

Source - pixi/textures/BaseTexture.js, line 200

updateSourceImage(newSrc)

Changes the source image of the texture

Parameters:
Name Type Description
newSrc String

the path of the image

Source - pixi/textures/BaseTexture.js, line 174
Phaser Copyright © 2012-2014 Photon Storm Ltd.
Documentation generated by JSDoc 3.3.0-dev on Tue Nov 25 2014 00:18:06 GMT-0000 (GMT) using the DocStrap template.