Classes
- AbstractMaskSystem
- AbstractMultiResource
- AccessibilityManager
- AnimatedSprite
- Application
- ArrayResource
- AssetLoader
- Attribute
- BackgroundLoader
- BackgroundSystem
- BaseImageResource
- BasePrepare
- BaseRenderTexture
- BaseTexture
- BasisParser
- BatchDrawCall
- BatchGeometry
- BatchRenderer
- BatchShaderGenerator
- BatchSystem
- BatchTextureArray
- BitmapFont
- BitmapFontData
- BitmapText
- BlobResource
- Bounds
- Buffer
- BufferResource
- BufferSystem
- Cache
- CanvasContextSystem
- CanvasExtract
- CanvasMaskSystem
- CanvasObjectRendererSystem
- CanvasPrepare
- CanvasRenderer
- CanvasResource
- Circle
- CompressedTextureResource
- Container
- ContextSystem
- CountLimiter
- CubeResource
- DepthResource
- DisplayObject
- Ellipse
- EventBoundary
- EventSystem
- Extract
- FederatedEvent
- FederatedMouseEvent
- FederatedPointerEvent
- FederatedWheelEvent
- FillStyle
- Filter
- FilterSystem
- Framebuffer
- FramebufferSystem
- GenerateTextureSystem
- Geometry
- GeometrySystem
- GLFramebuffer
- GLProgram
- GLTexture
- Graphics
- GraphicsData
- GraphicsGeometry
- ImageBitmapResource
- ImageResource
- LineStyle
- MaskData
- MaskSystem
- Matrix
- Mesh
- MeshBatchUvs
- MeshGeometry
- MeshMaterial
- MultisampleSystem
- NineSlicePlane
- ObjectRenderer
- ObjectRendererSystem
- ObservablePoint
- ParticleContainer
- ParticleRenderer
- PlaneGeometry
- PluginSystem
- Point
- Polygon
- Prepare
- Program
- ProjectionSystem
- Quad
- QuadUv
- Rectangle
- Renderer
- RenderTexture
- RenderTexturePool
- RenderTextureSystem
- Resolver
- Resource
- RopeGeometry
- RoundedRectangle
- Runner
- ScissorSystem
- Shader
- ShaderSystem
- SimpleMesh
- SimplePlane
- SimpleRope
- Sprite
- SpriteMaskFilter
- Spritesheet
- StartupSystem
- State
- StateSystem
- StencilSystem
- SVGResource
- SystemManager
- Text
- TextMetrics
- TextStyle
- Texture
- TextureGCSystem
- TextureMatrix
- TextureSystem
- Ticker
- TickerPlugin
- TilingSprite
- TilingSpriteRenderer
- TimeLimiter
- Transform
- TransformFeedback
- TransformFeedbackSystem
- UniformGroup
- VideoResource
- ViewableBuffer
- ViewSystem
- CanvasGraphicsRenderer
- CanvasMeshRenderer
- CanvasSpriteRenderer
- TextureUvs
Interface Definitions
-
This developer convenience object allows developers to group together the various asset parsers into a single object.
-
Initialization options object for Asset Class.
Properties:
Name Type Description basePath
string a base path for any assets loaded
loader
{ parsers? : LoaderParser[] } loader options to configure the loader with, currently only parsers!
manifest
string | ResolverManifest a manifest to tell the asset loader upfront what all your assets are this can be the manifest object itself, or a URL to the manifest.
resolver
{ urlParsers? : PIXI.ResolveURLParser[], preferOrders? : PIXI.PreferOrder[] } resolver specific options
texturePreference
{ resolution? : number | number[], format? : string | string[] } optional preferences for which textures preferences you have when resolving assets for example you might set the resolution to 0.5 if the user is on a rubbish old phone or you might set the resolution to 2 if the user is on a retina display
-
Strict extension format that is used internally for registrations.
Properties:
Name Type Description type
PIXI.ExtensionType[] The extension type, always expressed as multiple, even if a single
-
Format when registering an extension. Generally, the extension should have these values as
extension
static property, but you can override name or type by providing an object.Properties:
Name Type Description name
string Optional. Some plugins provide an API name/property, such as Renderer plugins
priority
number Optional, used for sorting the plugins in a particular order
ref
any Reference to the plugin object/class
type
PIXI.ExtensionType | PIXI.ExtensionType[] The extension type, can be multiple types
-
Describes the shape for a FederatedEvent's'
eventTarget
.Properties:
Name Type Description children
ReadonlyArray<PIXI.FederatedEventTarget> The children of this event target.
cursor
Cursor | string The cursor preferred when the mouse pointer is hovering over.
hitArea
IHitArea | null The hit-area specifies the area for which pointer events should be captured by this event target.
interactive
boolean Whether this event target should fire UI events.
interactiveChildren
boolean Whether this event target has any children that need UI events. This can be used optimize event propagation.
parent
PIXI.FederatedEventTarget The parent of this event target.
-
Format detection is useful for detecting feature support on the current platform.
Properties:
Name Type Description add
(formats: string[]) => Promise<string[]> Add formats (file extensions) to the existing list of formats. Return an new array with added formats, do not mutate the formats argument.
extension
ExtensionMetadata Should be ExtensionType.DetectionParser
remove
(formats: string[]) => Promise<string[]> Remove formats (file extensions) from the list of supported formats. This is used when uninstalling this DetectionParser. Return an new array with filtered formats, do not mutate the formats argument.
test
() => Promise<boolean> Browser/platform feature detection supported if return true
-
This interface describes all the DOM dependent calls that Pixi makes throughout its codebase. Implementations of this interface can be used to make sure Pixi will work in any environment, such as browser, Web Workers, and Node.js.
Properties:
Name Type Description createCanvas
(width: number, height: number) => ICanvas Returns a canvas object that can be used to create a webgl context.
getBaseUrl
() => string Returns the current base URL For browser environments this is either the document.baseURI or window.location.href
getNavigator
() => { userAgent : string } Returns a partial implementation of the browsers window.navigator
getWebGLRenderingContext
() => typeof WebGLRenderingContext Returns a webgl rendering context.
-
Any plugin that's usable for Application should contain these methods.
-
Interface for elements like Sprite, Mesh etc. for batching.
-
Properties:
Name Type Description height
number Height of character in page.
id
number Unique id of character
page
number width
number Width of character in page.
x
number x-position of character in page.
xadvance
number Advancement to apply to next character.
xoffset
number x-offset to apply when rendering character
y
number y-position of character in page.
yoffset
number y-offset to apply when rendering character.
-
Properties:
Name Type Description lineHeight
number Line height, in pixels.
-
Properties:
Name Type Description distanceRange
number Range of distance
fieldType
string Type of distance field
-
Properties:
Name Type Description face
string Font face
size
number Font size
-
Properties:
Name Type Description amount
number x-offset to apply between first & second characters when they are next to each other.
first
number First character of pair
second
number Second character of pair
-
Properties:
Name Type Description file
string File name
id
number Unique id for bitmap texture
-
Properties:
Name Type Default Description alphaMode
PIXI.ALPHA_MODES PIXI.ALPHA_MODES.UNPACK Pre multiply the image alpha. Note: for MSDF/SDF fonts, alphaMode is not supported.
anisotropicLevel
number PIXI.settings.ANISOTROPIC_LEVEL Anisotropic filtering level of texture.
chars
string | (string | string[])[] PIXI.BitmapFont.ALPHANUMERIC Characters included in the font set. You can also use ranges. For example,
[['a', 'z'], ['A', 'Z'], "!@#$%^&*()~{}[] "]
. Don't forget to include spaces ' ' in your character set!mipmap
PIXI.MIPMAP_MODES PIXI.settings.MIPMAP_TEXTURES If mipmapping is enabled for texture. For instance, by default PixiJS only enables mipmapping on Power-of-Two textures. If your textureWidth or textureHeight are not power-of-two, you may consider enabling mipmapping to get better quality with lower font sizes. Note: for MSDF/SDF fonts, mipmapping is not supported.
padding
number 4 Padding between glyphs on texture atlas. Lower values could mean more visual artifacts and bleeding from other glyphs, larger values increase the space required on the texture.
resolution
number 1 Render resolution for glyphs.
scaleMode
PIXI.SCALE_MODES PIXI.settings.SCALE_MODE Default scale mode, linear, nearest. Nearest can be helpful for bitmap-style fonts.
textureHeight
number 512 Optional height of atlas, smaller values to reduce memory.
textureWidth
number 512 Optional width of atlas, smaller values to reduce memory.
-
Common interface for HTMLCanvasElement, OffscreenCanvas, and other custom canvas classes.
Properties:
Name Type Description height
number Height of the canvas.
parentNode
ICanvasParentNode | null Parent node of the canvas.
style
ICanvasStyle Style of the canvas.
width
number Width of the canvas.
-
Common interface for CanvasRenderingContext2D, OffscreenCanvasRenderingContext2D, and other custom canvas 2D context.
-
Common interface for points. Both Point and ObservablePoint implement it
Properties:
Name Type Description x
number X coord
y
number Y coord
-
Common interface for points. Both Point and ObservablePoint implement it
Properties:
Name Type Description x
number X coord
y
number Y coord
-
Interface for Container to interface with Renderer.
-
Interface for DisplayObject to interface with Renderer. The minimum APIs needed to implement a renderable object.
Properties:
Name Type Description parent
PIXI.IRenderableContainer Object must have a parent container
transform
PIXI.Transform Object must have a transform
-
Starard Interface for a Pixi renderer.
Properties:
Name Type Description runners
{ [key: string]: PIXI.Runner } a collection of runners defined by the user
height
number the height of the screen
lastObjectRendered
PIXI.IRenderableObject the last object rendered by the renderer. Useful for other plugins like interaction managers
plugins
IRendererPlugins Collection of plugins
rendererLogId
string When logging Pixi to the console, this is the name we will show
renderingToScreen
boolean Flag if we are rendering to the screen vs renderTexture
resolution
number The resolution / device pixel ratio of the renderer.
screen
PIXI.Rectangle Measurements of the screen. (0, 0, screenWidth, screenHeight). Its safe to use as filterArea or hitArea for the whole stage.
type
PIXI.RENDERER_TYPE The type of the renderer.
view
PIXI.ICanvas The canvas element that everything is drawn to.
width
number the width of the screen
-
Shape of supported resource plugins
-
Interface for systems used by the PIXI.Renderer.
-
A prefer order lets the resolver know which assets to prefer depending on the various parameters passed to it.
Properties:
Name Type Description priority
string[] the importance order of the params
-
the object returned when a key is resolved to an asset. it will contain any additional information passed in the asset was added.
-
Structure of a bundle found in a manfest file
-
Format for url parser, will test a string and if it pass will then parse it, turning it into an ResolveAsset
Properties:
Name Type Description config
Record<string, any> A config to adjust the parser
parse
(value: string) => ResolveAsset the function that will convert the url into an object
test
(url: string) => boolean the test to perform on the url to determin if it should be parsed
-
Options passed to the ViewSystem
Properties:
Name Type Description autoDensity
boolean Resizes renderer view in CSS pixels to allow for resolutions other than 1.
height
number The height of the screen.
resolution
number The resolution / device pixel ratio of the renderer.
view
PIXI.ICanvas The canvas to use as a view, optional.
width
number The width of the screen.
Namespaces
Members
Regexp for data URI. Based on: https://github.com/ragingwind/data-uri-regex
- Default Value:
- undefined
Example
data:image/png;base64
Conversion factor for converting degrees to radians.
Graphics curves resolution settings. If adaptive
flag is set to true
,
the resolution is calculated based on the curve's length to ensure better visual quality.
Adaptive draw works with bezierCurveTo
and quadraticCurveTo
.
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
adaptive |
boolean |
<optional> |
true |
flag indicating if the resolution should be adaptive |
maxLength |
number |
<optional> |
10 |
maximal length of a single segment of the curve (if adaptive = false, ignored) |
maxSegments |
number |
<optional> |
2048 |
maximal number of segments in the curve (if adaptive = false, ignored) |
minSegments |
number |
<optional> |
8 |
minimal number of segments in the curve (if adaptive = false, ignored) |
PIXI.INSTALLED Array<PIXI.IResourcePlugin> staticreadonly
Collection of installed resource types, class must extend PIXI.Resource.
Example
class CustomResource extends PIXI.Resource {
// MUST have source, options constructor signature
// for auto-detected resources to be created.
constructor(source, options) {
super();
}
upload(renderer, baseTexture, glTexture) {
// Upload with GL
return true;
}
// Used to auto-detect resource
static test(source, extension) {
return extension === 'xyz' || source instanceof SomeClass;
}
}
// Install the new resource type
PIXI.INSTALLED.push(CustomResource);
Two Pi.
Conversion factor for converting radians to degrees.
Default filter vertex shader
Default vertex shader
Asset extension for loading spritesheets.
String of the current PIXI version.
- Default Value:
- "$_VERSION"
Enums
PIXI.ALPHA_MODESnumber
How to treat textures with premultiplied alpha
Properties:
Name | Description |
---|---|
NO_PREMULTIPLIED_ALPHA |
Source is not premultiplied, leave it like that. Option for compressed and data textures that are created from typed arrays. |
NPM |
Alias for NO_PREMULTIPLIED_ALPHA. |
PMA |
Alias for PREMULTIPLIED_ALPHA. |
PREMULTIPLIED_ALPHA |
Source is already premultiplied
Example: spine atlases with |
PREMULTIPLY_ON_UPLOAD |
Source is not premultiplied, premultiply on upload. Default option, used for all loaded images. |
UNPACK |
Default option, alias for PREMULTIPLY_ON_UPLOAD. |
PIXI.BUFFER_BITSnumber
Bitwise OR of masks that indicate the buffers to be cleared.
Properties:
Name | Description |
---|---|
COLOR |
Indicates the buffers currently enabled for color writing. |
DEPTH |
Indicates the depth buffer. |
STENCIL |
Indicates the stencil buffer. |
PIXI.BUFFER_TYPEnumber
Constants for various buffer types in Pixi
- See:
Properties:
Name | Description |
---|---|
ARRAY_BUFFER |
buffer type for using attribute data |
ELEMENT_ARRAY_BUFFER |
buffer type for using as an index buffer |
UNIFORM_BUFFER |
the buffer type is for uniform buffer objects |
PIXI.CLEAR_MODESnumber
Configure whether filter textures are cleared after binding.
Filter textures need not be cleared if the filter does not use pixel blending. CLEAR_MODES.BLIT will detect this and skip clearing as an optimization.
Properties:
Name | Description |
---|---|
AUTO |
Alias for BLIT |
BLEND |
Do not clear the filter texture. The filter's output will blend on top of the output texture. |
BLIT |
Clear only if FilterSystem.forceClear is set or if the filter uses pixel blending. |
CLEAR |
Always clear the filter texture. |
NO |
Alias for BLEND, same as |
YES |
Alias for CLEAR, same as |
PIXI.COLOR_MASK_BITSnumber
Bitwise OR of masks that indicate the color channels that are rendered to.
Properties:
Name | Description |
---|---|
ALPHA |
Alpha channel. |
BLUE |
Blue channel. |
GREEN |
Green channel |
RED |
Red channel. |
PIXI.DRAW_MODESnumber
Various webgl draw modes. These can be used to specify which GL drawMode to use under certain situations and renderers.
Properties:
Name | Description |
---|---|
LINE_LOOP |
|
LINE_STRIP |
|
LINES |
|
POINTS |
|
TRIANGLE_FAN |
|
TRIANGLE_STRIP |
|
TRIANGLES |
PIXI.ENVnumber
Different types of environments for WebGL.
Properties:
Name | Description |
---|---|
WEBGL |
Version 1 of WebGL |
WEBGL_LEGACY |
Used for older v1 WebGL devices. PixiJS will aim to ensure compatibility with older / less advanced devices. If you experience unexplained flickering prefer this environment. |
WEBGL2 |
Version 2 of WebGL |
PIXI.FORMATSnumber
Various GL texture/resources formats.
Properties:
Name | Default | Description |
---|---|---|
ALPHA |
6406 | |
DEPTH_COMPONENT |
6402 | |
DEPTH_STENCIL |
34041 | |
LUMINANCE |
6409 | |
LUMINANCE_ALPHA |
6410 | |
RED |
6403 | |
RED_INTEGER |
36244 | |
RG |
33319 | |
RG_INTEGER |
33320 | |
RGB |
6407 | |
RGB_INTEGER |
36248 | |
RGBA |
6408 | |
RGBA_INTEGER |
36249 |
PIXI.GC_MODESnumber
The gc modes that are supported by pixi.
The PIXI.settings.GC_MODE Garbage Collection mode for PixiJS textures is AUTO If set to GC_MODE, the renderer will occasionally check textures usage. If they are not used for a specified period of time they will be removed from the GPU. They will of course be uploaded again when they are required. This is a silent behind the scenes process that should ensure that the GPU does not get filled up.
Handy for mobile devices! This property only affects WebGL.
Properties:
Name | Description |
---|---|
AUTO |
Garbage collection will happen periodically automatically |
MANUAL |
Garbage collection will need to be called manually |
PIXI.INTERNAL_FORMATSnumber
WebGL internal formats, including compressed texture formats provided by extensions
Properties:
Name | Default | Description |
---|---|---|
COMPRESSED_R11_EAC |
0x9270 | |
COMPRESSED_RG11_EAC |
0x9272 | |
COMPRESSED_RGB_ATC_WEBGL |
0x8C92 | |
COMPRESSED_RGB_ETC1_WEBGL |
0x8D64 | |
COMPRESSED_RGB_PVRTC_2BPPV1_IMG |
0x8C01 | |
COMPRESSED_RGB_PVRTC_4BPPV1_IMG |
0x8C00 | |
COMPRESSED_RGB_S3TC_DXT1_EXT |
0x83F0 | |
COMPRESSED_RGB8_ETC2 |
0x9274 | |
COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 |
0x9276 | |
COMPRESSED_RGBA_ASTC_4x4_KHR |
0x93B0 | |
COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL |
0x8C92 | |
COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL |
0x87EE | |
COMPRESSED_RGBA_PVRTC_2BPPV1_IMG |
0x8C03 | |
COMPRESSED_RGBA_PVRTC_4BPPV1_IMG |
0x8C02 | |
COMPRESSED_RGBA_S3TC_DXT1_EXT |
0x83F1 | |
COMPRESSED_RGBA_S3TC_DXT3_EXT |
0x83F2 | |
COMPRESSED_RGBA_S3TC_DXT5_EXT |
0x83F3 | |
COMPRESSED_RGBA8_ETC2_EAC |
0x9278 | |
COMPRESSED_SIGNED_R11_EAC |
0x9271 | |
COMPRESSED_SIGNED_RG11_EAC |
0x9273 | |
COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT |
35917 | |
COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT |
35918 | |
COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT |
35919 | |
COMPRESSED_SRGB_S3TC_DXT1_EXT |
35916 | |
COMPRESSED_SRGB8_ALPHA8_ETC2_EAC |
0x9279 | |
COMPRESSED_SRGB8_ETC2 |
0x9275 | |
COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 |
0x9277 |
PIXI.LINE_CAPstring
Support line caps in PIXI.LineStyle
for graphics.
- See:
Properties:
Name | Description |
---|---|
BUTT |
'butt': don't add any cap at line ends (leaves orthogonal edges) |
ROUND |
'round': add semicircle at ends |
SQUARE |
'square': add square at end (like |
PIXI.LINE_JOINstring
Supported line joints in PIXI.LineStyle
for graphics.
- See:
Properties:
Name | Description |
---|---|
BEVEL |
'bevel': add a square butt at each end of line segment and fill the triangle at turn |
MITER |
'miter': make a sharp corner where outer part of lines meet |
ROUND |
'round': add an arc at the joint |
PIXI.MASK_TYPESnumber
Constants for mask implementations.
We use type
suffix because it leads to very different behaviours
Properties:
Name | Description |
---|---|
COLOR |
Color mask (RGBA) |
NONE |
Mask is ignored |
SCISSOR |
Scissor mask, rectangle on screen, cheap |
SPRITE |
Mask that uses SpriteMaskFilter, uses temporary RenderTexture |
STENCIL |
Stencil mask, 1-bit, medium, works only if renderer supports stencil |
PIXI.MIPMAP_MODESnumber
Mipmap filtering modes that are supported by pixi.
The PIXI.settings.MIPMAP_TEXTURES affects default texture filtering.
Mipmaps are generated for a baseTexture if its mipmap
field is ON
,
or its POW2
and texture dimensions are powers of 2.
Since WebGL 1 don't support mipmap for non-power-of-two textures,
ON
option will work like POW2
for WebGL 1.
This property only affects WebGL.
Properties:
Name | Description |
---|---|
OFF |
No mipmaps. |
ON |
Always generate mipmaps. |
ON_MANUAL |
Use mipmaps, but do not auto-generate them; this is used with a resource that supports buffering each level-of-detail. |
POW2 |
Generate mipmaps if texture dimensions are powers of 2. |
PIXI.MSAA_QUALITYnumber
Constants for multi-sampling antialiasing.
- See:
Properties:
Name | Description |
---|---|
HIGH |
Try 8 samples |
LOW |
Try 2 samples |
MEDIUM |
Try 4 samples |
NONE |
No multisampling for this renderTexture |
PIXI.PRECISIONstring
Constants that specify float precision in shaders.
Properties:
Name | Default | Description |
---|---|---|
HIGH |
'highp' | |
LOW |
'lowp' | |
MEDIUM |
'mediump' |
PIXI.RENDERER_TYPEnumber
Constant to identify the Renderer Type.
Properties:
Name | Description |
---|---|
CANVAS |
Canvas render type. |
UNKNOWN |
Unknown render type. |
WEBGL |
WebGL render type. |
PIXI.SAMPLER_TYPESnumber
Various sampler types. Correspond to sampler
, isampler
, usampler
GLSL types respectively.
WebGL1 works only with FLOAT.
Properties:
Name | Default | Description |
---|---|---|
FLOAT |
0 | |
INT |
1 | |
UINT |
2 |
PIXI.SCALE_MODESnumber
The scale modes that are supported by pixi.
The PIXI.settings.SCALE_MODE scale mode affects the default scaling mode of future operations. It can be re-assigned to either LINEAR or NEAREST, depending upon suitability.
Properties:
Name | Description |
---|---|
LINEAR |
Smooth scaling |
NEAREST |
Pixelating scaling |
PIXI.SHAPESnumber
Constants that identify shapes, mainly to prevent instanceof
calls.
Properties:
Name | Description |
---|---|
CIRC |
Circle |
ELIP |
Ellipse |
POLY |
Polygon |
RECT |
Rectangle |
RREC |
Rounded Rectangle |
PIXI.TARGETSnumber
Various GL target types.
Properties:
Name | Default | Description |
---|---|---|
TEXTURE_2D |
3553 | |
TEXTURE_2D_ARRAY |
35866 | |
TEXTURE_CUBE_MAP |
34067 | |
TEXTURE_CUBE_MAP_NEGATIVE_X |
34070 | |
TEXTURE_CUBE_MAP_NEGATIVE_Y |
34072 | |
TEXTURE_CUBE_MAP_NEGATIVE_Z |
34074 | |
TEXTURE_CUBE_MAP_POSITIVE_X |
34069 | |
TEXTURE_CUBE_MAP_POSITIVE_Y |
34071 | |
TEXTURE_CUBE_MAP_POSITIVE_Z |
34073 |
PIXI.TEXT_GRADIENTobject
Constants that define the type of gradient on text.
Properties:
Name | Description |
---|---|
LINEAR_HORIZONTAL |
Linear gradient |
LINEAR_VERTICAL |
Vertical gradient |
PIXI.TYPESnumber
Various GL data format types.
Properties:
Name | Default | Description |
---|---|---|
BYTE |
5120 | |
FLOAT |
5126 | |
FLOAT_32_UNSIGNED_INT_24_8_REV |
36269 | |
HALF_FLOAT |
36193 | |
INT |
5124 | |
SHORT |
5122 | |
UNSIGNED_BYTE |
5121 | |
UNSIGNED_INT |
5125 | |
UNSIGNED_INT_10F_11F_11F_REV |
35899 | |
UNSIGNED_INT_2_10_10_10_REV |
33640 | |
UNSIGNED_INT_24_8 |
34042 | |
UNSIGNED_INT_5_9_9_9_REV |
35902 | |
UNSIGNED_SHORT |
5123 | |
UNSIGNED_SHORT_4_4_4_4 |
32819 | |
UNSIGNED_SHORT_5_5_5_1 |
32820 | |
UNSIGNED_SHORT_5_6_5 |
33635 |
PIXI.UPDATE_PRIORITYnumber
Represents the update priorities used by internal PIXI classes when registered with the PIXI.Ticker object. Higher priority items are updated first and lower priority items, such as render, should go later.
Properties:
Name | Default | Description |
---|---|---|
HIGH |
25 |
High priority updating, PIXI.VideoBaseTexture and {@link PIXI.AnimatedSprite} |
LOW |
-25 |
Low priority used for PIXI.Application rendering. |
NORMAL |
0 |
Default priority for ticker events, see PIXI.Ticker#add. |
UTILITY |
-50 |
Lowest priority used for PIXI.BasePrepare utility. |
PIXI.WRAP_MODESnumber
The wrap modes that are supported by pixi.
The PIXI.settings.WRAP_MODE wrap mode affects the default wrapping mode of future operations. It can be re-assigned to either CLAMP or REPEAT, depending upon suitability. If the texture is non power of two then clamp will be used regardless as WebGL can only use REPEAT if the texture is po2.
This property only affects WebGL.
Properties:
Name | Description |
---|---|
CLAMP |
The textures uvs are clamped |
MIRRORED_REPEAT |
The texture uvs tile and repeat with mirroring |
REPEAT |
The texture uvs tile and repeat |
PIXI.BLEND_MODESnumber
Various blend modes supported by PIXI.
IMPORTANT - The WebGL renderer only supports the NORMAL, ADD, MULTIPLY and SCREEN blend modes. Anything else will silently act like NORMAL.
Properties:
Name | Description |
---|---|
ADD |
|
ADD_NPM |
|
COLOR |
|
COLOR_BURN |
|
COLOR_DODGE |
|
DARKEN |
|
DIFFERENCE |
|
DST_ATOP |
|
DST_IN |
|
DST_OUT |
|
DST_OVER |
|
ERASE |
|
EXCLUSION |
|
HARD_LIGHT |
|
HUE |
|
LIGHTEN |
|
LUMINOSITY |
|
MULTIPLY |
|
NONE |
|
NORMAL |
|
NORMAL_NPM |
|
OVERLAY |
|
SATURATION |
|
SCREEN |
|
SCREEN_NPM |
|
SOFT_LIGHT |
|
SRC_ATOP |
|
SRC_IN |
|
SRC_OUT |
|
SRC_OVER |
|
SUBTRACT |
|
XOR |
PIXI.ExtensionType
Collection of valid extension types.
Properties:
Name | Description |
---|---|
Application |
Application plugins |
CacheParser |
Parsers for Assets cache. |
CanvasRendererPlugin |
Plugins for CanvasRenderer |
Loader |
Plugins to use with Loader |
LoadParser |
Parsers for Assets loader. |
RendererPlugin |
Plugins for Renderer |
ResolveParser |
Parsers for Assets resolvers. |
Type Definitions
- See:
Types that can be passed to drawImage
A number, or a string containing a number.
Properties:
Name | Type | Description |
---|---|---|
ascent |
number |
Font ascent |
descent |
number |
Font descent |
fontSize |
number |
Font size |
Size object, contains width and height
Properties:
Name | Type | Description |
---|---|---|
height |
number |
Height component |
width |
number |
Width component |
The tracking data for each pointer held in the state of an PIXI.EventBoundary.
pressTargetsByButton: {
[id: number]: FederatedEventTarget[];
};
clicksByButton: {
[id: number]: {
clickCount: number;
target: FederatedEventTarget;
timeStamp: number;
};
};
overTargets: FederatedEventTarget[];
Properties:
Name | Type | Description |
---|---|---|
clicksByButton |
Record<number, object> |
Holds clicking data for each button of the pointer. |
overTargets |
Array<PIXI.DisplayObject> |
The DisplayObject propagation path over which the pointer is hovering. |
pressTargetsByButton |
Record<PIXI.FederatedEventTarget, number> |
The pressed display objects' propagation paths by each button of the pointer. |
Methods
autoDetectResource (source, options) PIXI.Resource
Create a resource element from a single source element. This
auto-detects which type of resource to create. All resources that
are auto-detectable must have a static test
method and a constructor
with the arguments (source, options?)
. Currently, the supported
resources for auto-detection include:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
source |
string | unknown |
Resource source, this can be the URL to the resource, a typed-array (for BufferResource), HTMLVideoElement, SVG data-uri or any other resource that can be auto-detected. If not resource is detected, it's assumed to be an ImageResource. |
||
options |
object |
<optional> |
Pass-through options to use for Resource |
|
options.width |
number |
<optional> |
Width of BufferResource or SVG rasterization |
|
options.height |
number |
<optional> |
Height of BufferResource or SVG rasterization |
|
options.autoLoad |
boolean |
<optional> |
true |
Image, SVG and Video flag to start loading |
options.scale |
number |
<optional> |
1 |
SVG source scale. Overridden by width, height |
options.createBitmap |
boolean |
<optional> |
PIXI.settings.CREATE_IMAGE_BITMAP |
Image option to create Bitmap object |
options.crossorigin |
boolean |
<optional> |
true |
Image and Video option to set crossOrigin |
options.autoPlay |
boolean |
<optional> |
true |
Video option to start playing video immediately |
options.updateFPS |
number |
<optional> |
0 |
Video option to update how many times a second the texture should be updated from the video. Leave at 0 to update at every render |
Returns:
Type | Description |
---|---|
PIXI.Resource | The created resource. |
autoDetectRenderer (options) PIXI.Renderer | PIXI.CanvasRenderer
This helper function will automatically detect which renderer you should be using. WebGL is the preferred renderer as it is a lot faster. If WebGL is not supported by the browser then this function will return a canvas renderer
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
options |
object |
<optional> |
The optional renderer parameters |
|
options.width |
number |
<optional> |
800 |
the width of the renderers view |
options.height |
number |
<optional> |
600 |
the height of the renderers view |
options.view |
PIXI.ICanvas |
<optional> |
the canvas to use as a view, optional |
|
options.useContextAlpha |
boolean |
<optional> |
true |
Pass-through value for canvas' context |
options.autoDensity |
boolean |
<optional> |
false |
Resizes renderer view in CSS pixels to allow for resolutions other than 1 |
options.antialias |
boolean |
<optional> |
false |
sets antialias |
options.preserveDrawingBuffer |
boolean |
<optional> |
false |
enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context |
options.backgroundColor |
number | string |
<optional> |
0x000000 |
The background color of the rendered area (shown if not transparent). Also, accepts hex strings or color names (e.g., 'white'). |
options.background |
number | string |
<optional> |
Alias for |
|
options.backgroundAlpha |
number |
<optional> |
1 |
Value from 0 (fully transparent) to 1 (fully opaque). |
options.clearBeforeRender |
boolean |
<optional> |
true |
This sets if the renderer will clear the canvas or not before the new render pass. |
options.resolution |
number |
<optional> |
PIXI.settings.RESOLUTION |
The resolution / device pixel ratio of the renderer. |
options.forceCanvas |
boolean |
<optional> |
false |
prevents selection of WebGL renderer, even if such is present, this option only is available when using pixi.js-legacy or @pixi/canvas-renderer modules, otherwise it is ignored. |
options.powerPreference |
string |
<optional> |
Parameter passed to webgl context, set to "high-performance" for devices with dual graphics card webgl only |
|
options.hello |
boolean |
<optional> |
false |
Logs renderer type and version. |
Returns:
Type | Description |
---|---|
PIXI.Renderer | PIXI.CanvasRenderer | Returns WebGL renderer if available, otherwise CanvasRenderer |
The idea of a relative epsilon comparison is to find the difference between the two numbers,
and see if it is less than a given epsilon.
A good epsilon would be the N% of the largest of the two values or Math.EPSILON
.
Note: Only available with @pixi/math-extras.
Name | Type | Description |
---|---|---|
a |
number |
First floating number to compare. |
b |
number |
Second floating number to compare. |
epsilon |
number |
The epsilon to compare to. The larger the epsilon, the easier for the numbers to be considered equals. |
Returns:
Type | Description |
---|---|
boolean | Returns true if the difference between the values is less than the given epsilon;
otherwise false . |
Computes the point where non-coincident and non-parallel Lines intersect.
Coincident or parallel lines return a NaN
point {x: NaN, y: NaN}
.
The intersection point may land outside the extents of the lines.
Note: Only available with @pixi/math-extras.
Name | Type | Description |
---|---|---|
aStart |
IPointData |
First point of the first line. |
aEnd |
IPointData |
Second point of the first line. |
bStart |
IPointData |
First point of the second line. |
bEnd |
IPointData |
Second point of the second line. |
outPoint |
IPointData |
A Point-like object in which to store the value, optional (otherwise will create a new Point). |
Returns:
Type | Description |
---|---|
IPointData | The point where the lines intersect or a NaN Point. |
parseDDS (arrayBuffer) PIXI.CompressedTextureResource[]
Parses the DDS file header, generates base-textures, and puts them into the texture cache.
Name | Type | Description |
---|---|---|
arrayBuffer |
ArrayBuffer |
Returns:
Type | Description |
---|---|
PIXI.CompressedTextureResource[] |
Computes the point where non-coincident and non-parallel segments intersect.
Coincident, parallel or non-intersecting segments return a NaN
point {x: NaN, y: NaN}
.
The intersection point must land inside the extents of the segments or return a NaN
Point.
Note: Only available with @pixi/math-extras.
Name | Type | Description |
---|---|---|
aStart |
IPointData |
Starting point of the first segment. |
aEnd |
IPointData |
Ending point of the first segment. |
bStart |
IPointData |
Starting point of the second segment. |
bEnd |
IPointData |
Ending point of the second segment. |
outPoint |
IPointData |
A Point-like object in which to store the value, optional (otherwise will create a new Point). |
Returns:
Type | Description |
---|---|
IPointData | The point where the segments intersect or a NaN Point. |