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.NORMALto 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
-
_loadSvgSource()
-
Checks if
sourceis an SVG image and whether it's loaded via a URL or a data URI. Then calls_loadSvgSourceUsingDataUrior_loadSvgSourceUsingXhr. -
_loadSvgSourceUsingString(svgString)
-
Loads texture using an SVG string. The original SVG Image is stored as
origSourceand the created canvas is the newsource. The SVG is scaled usingsourceScale. Called by_loadSvgSourceUsingXhror_loadSvgSourceUsingDataUri.Name Type Description svgStringstring SVG source as string
Fires:
- event:loaded
-
_loadSvgSourceUsingXhr()
-
Loads an SVG string from
imageUrlusing 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 baseTexturePIXI.BaseTexture The BaseTexture to add to the cache.
idstring 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 array1Array First array to compare
array2Array 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 filterAreaRectangle The filter area
spriteSprite the target sprite
outputMatrixMatrix @alvin
-
destroy()
-
Destroys this base texture
-
destroy()
-
Destroys this texture
-
dispose()
-
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 sourcestring | HTMLImageElement | HTMLCanvasElement The source to create base texture from.
scaleModenumber PIXI.settings.SCALE_MODE optional See PIXI.SCALE_MODES for possible values
sourceScalenumber (auto) optional Scale for the original image, used with Svg images.
Returns:
Type Description PIXI.BaseTexture The new base texture. -
fromUrl(videoSrc, scaleMode){PIXI.VideoBaseTexture}
-
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 videoSrcstring | object | Array.<string> | Array.<object> The URL(s) for the video.
Name Type Description srcstring optional One of the source urls for the video
mimestring 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.
scaleModenumber 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 colornumber | 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 colornumber | 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 baseTexturestring | 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 MediamediaType type, eg.
imageSubsubType type, eg.
pngDataencoding encoding, eg.
base64Thedata actual data
-
FrameObjectobject
-
Properties:
Name Type Description texturePIXI.Texture The PIXI.Texture of the frame
timenumber the duration of the frame in ms
-
Sizeobject
-
Typedef for Size object.
Properties:
Name Type Description Widthwidth component
Heightheight component