Global

Members

autoUpdateboolean

Should the base texture automatically update itself, set to true by default

cachednumber

tint of the line to draw

cachednumber

tint of the fill

ifboolean

true the liens will be draw using LINES instead of TRIANGLE_STRIP

thenumber

alpha of the fill

Thenumber

type of the shape, see the Const.Shapes file for all the existing types,

thenumber

color of the fill

shape object to draw.

thenumber

alpha of the line to draw

thenumber

width of the line to draw

thenumber

color of the line to draw

valueboolean

The blend mode to be applied when this state is set. Apply a value of PIXI.BLEND_MODES.NORMAL to reset the blend mode. Setting this mode to anything other than NO_BLEND will automatically switch blending on.

Default Value:
  • PIXI.BLEND_MODES.NORMAL
See:

whetherboolean

or not the shape is filled with a colour

Methods

Checks if source is an SVG image and whether it's loaded via a URL or a data URI. Then calls _loadSvgSourceUsingDataUri or _loadSvgSourceUsingXhr.

_loadSvgSourceUsingString(svgString)

Loads texture using an SVG string. The original SVG Image is stored as origSource and the created canvas is the new source. The SVG is scaled using sourceScale. Called by _loadSvgSourceUsingXhr or _loadSvgSourceUsingDataUri.

Name Type Description
svgString string

SVG source as string

Fires:
  • event:loaded

Loads an SVG string from imageUrl using XHR and then calls _loadSvgSourceUsingString.

addToCache(baseTexture, id)

Adds a BaseTexture to the global BaseTextureCache. This cache is shared across the whole PIXI object.

Name Type Description
baseTexture PIXI.BaseTexture

The BaseTexture to add to the cache.

id string

The id that the BaseTexture will be stored against.

areArraysEqual(array1, array2){boolean}

Utility function to convert hexadecimal colors to strings, and simply return the color if it's a string. This version can also convert array of colors

Name Type Description
array1 Array

First array to compare

array2 Array

Second array to compare

Returns:
Type Description
boolean Do the arrays contain the same values in the same order

calculateScreenSpaceMatrix(filterArea, sprite, outputMatrix)

Calculates the mapped matrix

Name Type Description
filterArea Rectangle

The filter area

sprite Sprite

the target sprite

outputMatrix Matrix

@alvin

Destroys this base texture

Destroys this texture

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:

from(source, scaleMode, sourceScale){PIXI.BaseTexture}

Helper function that creates a base texture based on the source you provide. The source can be - image url, image element, canvas element.

Name Type Default Description
source string | HTMLImageElement | HTMLCanvasElement

The source to create base texture from.

scaleMode number PIXI.settings.SCALE_MODE optional

See PIXI.SCALE_MODES for possible values

sourceScale number (auto) optional

Scale for the original image, used with Svg images.

Returns:
Type Description
PIXI.BaseTexture The new base texture.

Helper function that creates a new BaseTexture based on the given video element. This BaseTexture can then be used to create a texture

Name Type Description
videoSrc string | object | Array.<string> | Array.<object>

The URL(s) for the video.

Name Type Description
src string optional

One of the source urls for the video

mime string optional

The mimetype of the video (e.g. 'video/mp4'). If not specified the url's extension will be used as the second part of the mime type.

scaleMode number

See PIXI.SCALE_MODES for possible values

Returns:
Type Description
PIXI.VideoBaseTexture Newly created VideoBaseTexture

getColor(color){string}

Utility function to convert hexadecimal colors to strings, and simply return the color if it's a string. This version can also convert array of colors

Name Type Description
color number | Array.<number>
Returns:
Type Description
string The color as a string.

getSingleColor(color){string}

Utility function to convert hexadecimal colors to strings, and simply return the color if it's a string.

Name Type Description
color number | Array.<number>
Returns:
Type Description
string The color as a string.

removeFromCache(baseTexture){PIXI.BaseTexture|null}

Remove a BaseTexture from the global BaseTextureCache.

Name Type Description
baseTexture string | PIXI.BaseTexture

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

Returns:
Type Description
PIXI.BaseTexture | null The BaseTexture that was removed.

Type Definitions

DecomposedDataUriobject

Typedef for decomposeDataUri return object.

Properties:
Name Type Description
Media mediaType

type, eg. image

Sub subType

type, eg. png

Data encoding

encoding, eg. base64

The data

actual data

FrameObjectobject

Properties:
Name Type Description
texture PIXI.Texture

The PIXI.Texture of the frame

time number

the duration of the frame in ms

Sizeobject

Typedef for Size object.

Properties:
Name Type Description
Width width

component

Height height

component