- See:
Properties:
Name | Type | Description |
---|---|---|
antialias |
boolean |
WebGL Only. Whether to enable anti-aliasing. This may affect performance. |
autoDensity |
boolean |
Whether the CSS dimensions of the renderer's view should be resized automatically. |
background |
PIXI.ColorSource |
Alias for PIXI.IRendererOptions.backgroundColor |
backgroundAlpha |
number |
Transparency of the background color, value from |
backgroundColor |
PIXI.ColorSource |
The background color used to clear the canvas. See PIXI.ColorSource for accepted color values. |
clearBeforeRender |
boolean |
Whether to clear the canvas before new render passes. |
context |
PIXI.IRenderingContext | null |
WebGL Only. User-provided WebGL rendering context object. |
eventFeatures |
Partial<PIXI.EventSystemFeatures> |
The event features that are enabled by the EventSystem This option only is available when using @pixi/events package (included in the pixi.js and pixi.js-legacy bundle), otherwise it will be ignored. |
eventMode |
PIXI.EventMode |
The default event mode mode for all display objects. This option only is available when using @pixi/events package (included in the pixi.js and pixi.js-legacy bundle), otherwise it will be ignored. |
height |
number |
The height of the renderer's view. |
hello |
boolean |
Whether to log the version and type information of renderer to console. |
powerPreference |
WebGLPowerPreference |
WebGL Only. A hint indicating what configuration of GPU is suitable for the WebGL context,
can be |
premultipliedAlpha |
boolean |
WebGL Only. Whether the compositor will assume the drawing buffer contains colors with premultiplied alpha. |
preserveDrawingBuffer |
boolean |
WebGL Only. Whether to enable drawing buffer preservation. If enabled, the drawing buffer will preserve
its value until cleared or overwritten. Enable this if you need to call |
resolution |
number |
The resolution / device pixel ratio of the renderer. |
useContextAlpha |
boolean | "notMultiplied" |
Deprecated since 7.0.0, use Pass-through value for canvas' context attribute WebGL Only: When set to |
view |
PIXI.ICanvas |
The canvas to use as the view. If omitted, a new canvas will be created. |
width |
number |
The width of the renderer's view. |
Extends
- GlobalMixins.IRendererOptions
- PIXI.BackgroundSystemOptions
- PIXI.ContextSystemOptions
- PIXI.ViewSystemOptions
- PIXI.StartupSystemOptions
Members
WebGL Only. Whether to enable anti-aliasing. This may affect performance.
Whether the CSS dimensions of the renderer's view should be resized automatically.
background PIXI.ColorSource
Alias for PIXI.IRendererOptions.backgroundColor
Transparency of the background color, value from 0
(fully transparent) to 1
(fully opaque).
backgroundColor PIXI.ColorSource
The background color used to clear the canvas. See PIXI.ColorSource for accepted color values.
Whether to clear the canvas before new render passes.
context PIXI.IRenderingContext | null
WebGL Only. User-provided WebGL rendering context object.
eventFeatures Partial<PIXI.EventSystemFeatures>
The event features that are enabled by the EventSystem This option only is available when using @pixi/events package (included in the pixi.js and pixi.js-legacy bundle), otherwise it will be ignored.
Example
const app = new PIXI.Application({
view: canvas,
events: {
move: true,
globalMove: false,
click: true,
wheel: true,
},
});
eventMode PIXI.EventMode
The default event mode mode for all display objects. This option only is available when using @pixi/events package (included in the pixi.js and pixi.js-legacy bundle), otherwise it will be ignored.
The height of the renderer's view.
Whether to log the version and type information of renderer to console.
WebGL Only. A hint indicating what configuration of GPU is suitable for the WebGL context,
can be 'default'
, 'high-performance'
or 'low-power'
.
Setting to 'high-performance'
will prioritize rendering performance over power consumption,
while setting to 'low-power'
will prioritize power saving over rendering performance.
WebGL Only. Whether the compositor will assume the drawing buffer contains colors with premultiplied alpha.
WebGL Only. Whether to enable drawing buffer preservation. If enabled, the drawing buffer will preserve
its value until cleared or overwritten. Enable this if you need to call toDataUrl
on the WebGL context.
The resolution / device pixel ratio of the renderer.
Deprecated since 7.0.0, use premultipliedAlpha
and backgroundAlpha
instead.
Pass-through value for canvas' context attribute alpha
. This option is for cases where the
canvas needs to be opaque, possibly for performance reasons on some older devices.
If you want to set transparency, please use backgroundAlpha
.
WebGL Only: When set to 'notMultiplied'
, the canvas' context attribute alpha
will be
set to true
and premultipliedAlpha
will be to false
.
view PIXI.ICanvas
The canvas to use as the view. If omitted, a new canvas will be created.
The width of the renderer's view.