Optional
options: Partial<IRendererOptions>See PIXI.settings.RENDER_OPTIONS for defaults.
Readonly
__multisample system instance
Readonly
_plugin system instance
Readonly
__view system instance
Readonly
backgroundbackground system instance
Readonly
batchBatch system instance
Readonly
bufferBuffer system instance
Readonly
contextContext system instance
Unique UID assigned to the renderer's WebGL context.
Readonly
eventsReadonly
extractReadonly
filterFilter system instance
Readonly
framebufferFramebuffer system instance
Readonly
geometryGeometry system instance
Readonly
glWebGL context, set by PIXI.ContextSystem this.context.
Global uniforms Add any uniforms you want shared across your shaders. the must be added before the scene is rendered for the first time as we dynamically buildcode to handle all global var per shader
Readonly
maskMask system instance
Readonly
object_render system instance
Readonly
optionsOptions passed to the constructor.
Readonly
prepareReadonly
projectionProjection system instance
Readonly
renderRenderTexture system instance
Readonly
runnersa collection of runners defined by the user
Readonly
scissorScissor system instance
Readonly
shaderShader system instance
Readonly
startupstartup system instance
Readonly
stateState system instance
Readonly
stencilStencil system instance
Readonly
textureTexture system instance
Readonly
textureTexture garbage collector system instance
Readonly
texturetextureGenerator system instance
Readonly
transformTransformFeedback system instance
Readonly
typeThe type of the renderer. will be PIXI.RENDERER_TYPE.CANVAS
Static
prefixedWhether CSS dimensions of canvas view should be resized to screen dimensions automatically.
the last object rendered by the renderer. Useful for other plugins like interaction managers
The number of msaa samples of the canvas.
Collection of plugins
When logging Pixi to the console, this is the name we will show
Flag if we are rendering to the screen vs renderTexture
The resolution / device pixel ratio of the renderer.
The resolution / device pixel ratio of the renderer.
Measurements of the screen. (0, 0, screenWidth, screenHeight).
Its safe to use as filterArea or hitArea for the whole stage.
The canvas element that everything is drawn to.
Create a bunch of runners based of a collection of ids
the runner ids to add
Add a new system to the renderer.
Class reference
Property name for system, if not specified
will use a static name
property on the class itself. This
name will be assigned as s property on the Renderer so make
sure it doesn't collide with properties on Renderer.
Return instance of renderer
Clear the frame buffer.
Removes everything from the renderer (event listeners, spritebatch, etc...)
Optional
removeView: booleanRemoves the Canvas element from the DOM. See: https://github.com/pixijs/pixijs/issues/2233
Calls each of the listeners registered for a given event.
A function that will run a runner and call the runners function but pass in different options to each system based on there name.
E.g. If you have two systems added called systemA
and systemB
you could call do the following:
system.emitWithCustomOptions(init, {
systemA: {...optionsForA},
systemB: {...optionsForB},
});
init
would be called on system A passing optionsForA
and on system B passing optionsForB
.
the runner to target
key value options for each system
Return an array listing the events for which the emitter has registered listeners.
Useful function that returns a texture of the display object that can then be used to create sprites This can be quite useful if your displayObject is complicated and needs to be reused multiple times.
The displayObject the object will be generated from.
Optional
options: IGenerateTextureOptionsGenerate texture options.
Optional
alphaMode?: ALPHA_MODESOptional
anisotropicLevel?: numberOptional
format?: FORMATSOptional
height?: numberOptional
mipmap?: MIPMAP_MODESOptional
multisample?: MSAA_QUALITYThe number of samples of the frame buffer. The default is the renderer's multisample.
Optional
pixiIdPrefix?: stringOptional
region?: RectangleThe region of the displayObject, that shall be rendered, if no region is specified, defaults to the local bounds of the displayObject.
Optional
resolution?: numberThe resolution / device pixel ratio of the texture being generated. The default is the renderer's resolution.
Optional
resourceOptions?: anyOptional
scaleMode?: SCALE_MODESOptional
target?: TARGETSOptional
type?: TYPESOptional
width?: numberOptional
wrapMode?: WRAP_MODESA texture of the graphics object.
Return the number of listeners listening to a given event.
Return the listeners registered for a given event.
Add a listener for a given event.
Optional
context: anyAdd a one-time listener for a given event.
Optional
context: anyRemove all listeners, or those of the specified event.
Optional
event: string | symbolRemove the listeners of a given event.
Optional
fn: (...args: any[]) => voidOptional
context: anyOptional
once: booleanRenders the object to its WebGL view.
The object to be rendered.
Optional
options: IRendererRenderOptionsObject to use for render options.
Optional
blit?: booleanOptional
clear?: booleanOptional
renderTexture?: RenderTextureOptional
skipUpdateTransform?: booleanOptional
transform?: MatrixResets the WebGL state so you can render things however you fancy!
Returns itself.
Resizes the WebGL view to the specified width and height.
The desired width of the screen.
The desired height of the screen.
Set up a system with a collection of SystemClasses and runners. Systems are attached dynamically to this class when added.
the config for the system manager
The Renderer draws the scene and all its content onto a WebGL enabled canvas.
This renderer should be used for browsers that support WebGL.
This renderer works by automatically managing WebGLBatches, so no need for Sprite Batches or Sprite Clouds. Don't forget to add the view to your DOM or you will not see anything!
Renderer is composed of systems that manage specific tasks. The following systems are added by default whenever you create a renderer:
projectionMatrix
, used by shaders to get NDC coordinates.The breadth of the API surface provided by the renderer is contained within these systems.
Memberof
PIXI