Classes
- AbstractBatchRenderer
- AbstractRenderer
- AccessibilityManager
- AnimatedSprite
- Application
- AppLoaderPlugin
- Attribute
- BasePrepare
- BaseRenderTexture
- BaseTexture
- BatchDrawCall
- BatchGeometry
- BatchPluginFactory
- BatchShaderGenerator
- BatchTextureArray
- BitmapFont
- BitmapFontData
- BitmapFontLoader
- BitmapText
- Bounds
- Buffer
- CanvasExtract
- CanvasGraphicsRenderer
- CanvasMaskManager
- CanvasMeshRenderer
- CanvasPrepare
- CanvasRenderer
- CanvasRenderTarget
- CanvasSpriteRenderer
- Circle
- Container
- CountLimiter
- DisplayObject
- Ellipse
- Extract
- FillStyle
- Filter
- FilterManager
- Framebuffer
- Geometry
- GLFramebuffer
- GLProgram
- GLTexture
- Graphics
- GraphicsData
- GraphicsGeometry
- InteractionData
- InteractionEvent
- InteractionManager
- LineStyle
- Loader
- LoaderResource
- MaskData
- Matrix
- Mesh
- MeshBatchUvs
- MeshGeometry
- MeshMaterial
- NineSlicePlane
- ObjectRenderer
- ObservablePoint
- ParticleContainer
- ParticleRenderer
- Point
- Polygon
- Prepare
- Program
- Quad
- QuadUv
- Rectangle
- Renderer
- RenderTexture
- RenderTexturePool
- RopeGeometry
- RoundedRectangle
- Runner
- Shader
- SimpleMesh
- SimplePlane
- SimpleRope
- Sprite
- SpriteMaskFilter
- Spritesheet
- SpritesheetLoader
- State
- System
- Text
- TextMetrics
- TextStyle
- Texture
- TextureLoader
- TextureMatrix
- TextureUvs
- Ticker
- TickerPlugin
- TilingSprite
- TilingSpriteRenderer
- TimeLimiter
- Transform
- TransformBase
- TransformStatic
- UniformGroup
- ViewableBuffer
- WebGLRenderer
Namespaces
- accessibility
- CanvasTinter
- canvasUtils
- extract
- extras
- filters
- graphicsUtils
- GroupD8
- groupD8
- interaction
- loaders
- mesh
- particles
- prepare
- resources
- settings
- systems
- ticker
- utils
Members
-
How to treat textures with premultiplied alpha
Properties:
Name Type Description NO_PREMULTIPLIED_ALPHAnumber Source is not premultiplied, leave it like that. Option for compressed and data textures that are created from typed arrays.
PREMULTIPLY_ON_UPLOADnumber Source is not premultiplied, premultiply on upload. Default option, used for all loaded images.
PREMULTIPLIED_ALPHAnumber Source is already premultiplied Example: spine atlases with
_pmasuffix.NPMnumber Alias for NO_PREMULTIPLIED_ALPHA.
UNPACKnumber Default option, alias for PREMULTIPLY_ON_UPLOAD.
PMAnumber Alias for PREMULTIPLIED_ALPHA.
-
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 Type Description NORMALnumber ADDnumber MULTIPLYnumber SCREENnumber OVERLAYnumber DARKENnumber LIGHTENnumber COLOR_DODGEnumber COLOR_BURNnumber HARD_LIGHTnumber SOFT_LIGHTnumber DIFFERENCEnumber EXCLUSIONnumber HUEnumber SATURATIONnumber COLORnumber LUMINOSITYnumber NORMAL_NPMnumber ADD_NPMnumber SCREEN_NPMnumber NONEnumber SRC_INnumber SRC_OUTnumber SRC_ATOPnumber DST_OVERnumber DST_INnumber DST_OUTnumber DST_ATOPnumber SUBTRACTnumber SRC_OVERnumber ERASEnumber XORnumber -
Bitwise OR of masks that indicate the buffers to be cleared.
Properties:
Name Type Description COLORnumber Indicates the buffers currently enabled for color writing.
DEPTHnumber Indicates the depth buffer.
STENCILnumber Indicates the stencil buffer.
-
How to clear renderTextures in filter
Properties:
Name Type Description BLENDnumber Preserve the information in the texture, blend above
CLEARnumber Must use
gl.clearoperationBLITnumber Clear or blit it, depends on device and level of paranoia
NOnumber Alias for BLEND, same as
falsein earlier versionsYESnumber Alias for CLEAR, same as
truein earlier versionsAUTOnumber Alias for BLIT
-
Regexp for data URI. Based on: https://github.com/ragingwind/data-uri-regex
Example
data:image/png;base64 -
Default filter vertex shader
-
Default vertex shader
-
Conversion factor for converting degrees to radians.
-
Various webgl draw modes. These can be used to specify which GL drawMode to use under certain situations and renderers.
Properties:
Name Type Description POINTSnumber LINESnumber LINE_LOOPnumber LINE_STRIPnumber TRIANGLESnumber TRIANGLE_STRIPnumber TRIANGLE_FANnumber -
Different types of environments for WebGL.
Properties:
Name Type Description WEBGL_LEGACYnumber 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.
WEBGLnumber Version 1 of WebGL
WEBGL2number Version 2 of WebGL
-
Various GL texture/resources formats.
Properties:
Name Type Default Description RGBAnumber 6408 RGBnumber 6407 ALPHAnumber 6406 LUMINANCEnumber 6409 LUMINANCE_ALPHAnumber 6410 DEPTH_COMPONENTnumber 6402 DEPTH_STENCILnumber 34041 -
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 Type Description AUTOnumber Garbage collection will happen periodically automatically
MANUALnumber Garbage collection will need to be called manually
-
Graphics curves resolution settings. If
adaptiveflag is set totrue, the resolution is calculated based on the curve's length to ensure better visual quality. Adaptive draw works withbezierCurveToandquadraticCurveTo.Properties:
Name Type Default Description adaptiveboolean false flag indicating if the resolution should be adaptive
maxLengthnumber 10 maximal length of a single segment of the curve (if adaptive = false, ignored)
minSegmentsnumber 8 minimal number of segments in the curve (if adaptive = false, ignored)
maxSegmentsnumber 2048 maximal number of segments in the curve (if adaptive = false, ignored)
-
Support line caps in
PIXI.LineStylefor graphics.- See:
Properties:
Name Type Description BUTTstring 'butt': don't add any cap at line ends (leaves orthogonal edges)
ROUNDstring 'round': add semicircle at ends
SQUAREstring 'square': add square at end (like
BUTTexcept more length at end) -
Supported line joints in
PIXI.LineStylefor graphics.- See:
Properties:
Name Type Description MITERstring 'miter': make a sharp corner where outer part of lines meet
BEVELstring 'bevel': add a square butt at each end of line segment and fill the triangle at turn
ROUNDstring 'round': add an arc at the joint
-
PIXI.loader PIXI.Loader Deprecated : since 5.0.0 static
-
- See:
-
Constants for mask implementations. We use
typesuffix because it leads to very different behavioursProperties:
Name Type Description NONEnumber Mask is ignored
SCISSORnumber Scissor mask, rectangle on screen, cheap
STENCILnumber Stencil mask, 1-bit, medium, works only if renderer supports stencil
SPRITEnumber Mask that uses SpriteMaskFilter, uses temporary RenderTexture
-
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
mipmapfield isON, or itsPOW2and texture dimensions are powers of 2. Due to platform restriction,ONoption will work likePOW2for webgl-1.This property only affects WebGL.
Properties:
Name Type Description OFFnumber No mipmaps
POW2number Generate mipmaps if texture dimensions are pow2
ONnumber Always generate mipmaps
-
Constants for multi-sampling antialiasing.
- See:
Properties:
Name Type Description NONEnumber No multisampling for this renderTexture
LOWnumber Try 2 samples
MEDIUMnumber Try 4 samples
HIGHnumber Try 8 samples
-
Two Pi.
-
Constants that specify float precision in shaders.
Properties:
Name Type Default Description LOWstring 'lowp' MEDIUMstring 'mediump' HIGHstring 'highp' -
Conversion factor for converting radians to degrees.
-
Constant to identify the Renderer Type.
Properties:
Name Type Description UNKNOWNnumber Unknown render type.
WEBGLnumber WebGL render type.
CANVASnumber Canvas render type.
-
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 Type Description LINEARnumber Smooth scaling
NEARESTnumber Pixelating scaling
-
Constants that identify shapes, mainly to prevent
instanceofcalls.Properties:
Name Type Description POLYnumber Polygon
RECTnumber Rectangle
CIRCnumber Circle
ELIPnumber Ellipse
RRECnumber Rounded Rectangle
-
Various GL target types.
Properties:
Name Type Default Description TEXTURE_2Dnumber 3553 TEXTURE_CUBE_MAPnumber 34067 TEXTURE_2D_ARRAYnumber 35866 TEXTURE_CUBE_MAP_POSITIVE_Xnumber 34069 TEXTURE_CUBE_MAP_NEGATIVE_Xnumber 34070 TEXTURE_CUBE_MAP_POSITIVE_Ynumber 34071 TEXTURE_CUBE_MAP_NEGATIVE_Ynumber 34072 TEXTURE_CUBE_MAP_POSITIVE_Znumber 34073 TEXTURE_CUBE_MAP_NEGATIVE_Znumber 34074 -
Constants that define the type of gradient on text.
Properties:
Name Type Description LINEAR_VERTICALnumber Vertical gradient
LINEAR_HORIZONTALnumber Linear gradient
-
Constants that specify the transform type.
Properties:
Name Type Description STATICnumber DYNAMICnumber -
Various GL data format types.
Properties:
Name Type Default Description UNSIGNED_BYTEnumber 5121 UNSIGNED_SHORTnumber 5123 UNSIGNED_SHORT_5_6_5number 33635 UNSIGNED_SHORT_4_4_4_4number 32819 UNSIGNED_SHORT_5_5_5_1number 32820 FLOATnumber 5126 HALF_FLOATnumber 36193 -
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 Type Default Description INTERACTIONnumber 50 Highest priority, used for PIXI.InteractionManager
HIGHnumber 25 High priority updating, PIXI.VideoBaseTexture and PIXI.AnimatedSprite
NORMALnumber 0 Default priority for ticker events, see PIXI.Ticker#add.
LOWnumber -25 Low priority used for PIXI.Application rendering.
UTILITYnumber -50 Lowest priority used for PIXI.BasePrepare utility.
-
String of the current PIXI version.
-
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 Type Description CLAMPnumber The textures uvs are clamped
REPEATnumber The texture uvs tile and repeat
MIRRORED_REPEATnumber The texture uvs tile and repeat with mirroring
Methods
-
PIXI.autoDetectRenderer (options)PIXI.Renderer | PIXI.CanvasRenderer static
-
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 Description optionsobject optional The optional renderer parameters
Name Type Default Description widthnumber 800 optional the width of the renderers view
heightnumber 600 optional the height of the renderers view
viewHTMLCanvasElement optional the canvas to use as a view, optional
transparentboolean false optional If the render view is transparent, default false
autoDensityboolean false optional Resizes renderer view in CSS pixels to allow for resolutions other than 1
antialiasboolean false optional sets antialias
preserveDrawingBufferboolean false optional enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context
backgroundColornumber 0x000000 optional The background color of the rendered area (shown if not transparent).
clearBeforeRenderboolean true optional This sets if the renderer will clear the canvas or not before the new render pass.
resolutionnumber 1 optional The resolution / device pixel ratio of the renderer, retina would be 2
forceCanvasboolean false optional 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.
powerPreferencestring optional Parameter passed to webgl context, set to "high-performance" for devices with dual graphics card webgl only
Returns:
Type Description PIXI.Renderer | PIXI.CanvasRenderer Returns WebGL renderer if available, otherwise CanvasRenderer -
Deprecations (backward compatibilities) are automatically applied for browser bundles in the UMD module format. If using Webpack or Rollup, you'll need to apply these deprecations manually by doing something like this:
Example
import * as PIXI from 'pixi.js'; PIXI.useDeprecated(); // MUST be bound to namespace
Type Definitions
-
- See:
-
Properties:
Name Type Description idstring pagenumber xnumber ynumber widthnumber heightnumber xoffsetnumber yoffsetnumber xadvancenumber -
Properties:
Name Type Description lineHeightnumber -
Properties:
Name Type Description facestring sizenumber -
Properties:
Name Type Description firstnumber secondnumber amountnumber -
Properties:
Name Type Description idnumber filestring -
Types that can be passed to drawImage
-
A number, or a string containing a number.
Properties:
Name Type Description ascentnumber Font ascent
descentnumber Font descent
fontSizenumber Font size
-
Plugin to be installed for handling specific Loader resources.
Properties:
Name Type Argument Description addfunction <optional>
Function to call immediate after registering plugin.
prePIXI.Loader.loaderMiddleware <optional>
Middleware function to run before load, the arguments for this are
(resource, next)usePIXI.Loader.loaderMiddleware <optional>
Middleware function to run after load, the arguments for this are
(resource, next) -
Size object, contains width and height
Properties:
Name Type Description widthnumber Width component
heightnumber Height component
Interface Definitions
-
Properties:
Name Type Argument Default Description charsstring | Array.<string> | Array.<Array.<string>> <optional>
PIXI.BitmapFont.ALPHANUMERIC the character set to generate
resolutionnumber <optional>
1 the resolution for rendering
paddingnumber <optional>
4 the padding between glyphs in the atlas
textureWidthnumber <optional>
512 the width of the texture atlas
textureHeightnumber <optional>
512 the height of the texture atlas
-
Interface for classes that represent a hit area.
It is implemented by the following classes:
-
Common interface for points. Both Point and ObservablePoint implement it
-
Common interface for points. Both Point and ObservablePoint implement it