PIXI.RenderTextureSystem

class RenderTextureSystem implements PIXI.ISystem

System plugin to the renderer to manage render textures.

Should be added after FramebufferSystem

Frames

The RenderTextureSystem holds a sourceFrame → destinationFrame projection. The following table explains the different coordinate spaces used:

Frame Description Coordinate System
sourceFrame The rectangle inside of which display-objects are being rendered World Space: The origin on the top-left
destinationFrame The rectangle in the render-target (canvas or texture) into which contents should be rendered If rendering to the canvas, this is in screen space and the origin is on the top-left. If rendering to a render-texture, this is in its base-texture's space with the origin on the bottom-left.
viewportFrame The framebuffer viewport corresponding to the destination-frame Window Coordinates: The origin is always on the bottom-left.

Constructor


new PIXI.RenderTextureSystem(renderer: PIXI.Renderer) → {}
Parameters:
Name Type Description
renderer PIXI.Renderer

The renderer this System works for.

Summary


Properties from RenderTextureSystem

number[]
clearColor

The clear background color as RGBA.

PIXI.RenderTexture | null
current
Array<PIXI.MaskData>
defaultMaskStack
PIXI.Rectangle
destinationFrame

The destination frame for the render-target's projection mapping.

PIXI.Rectangle
sourceFrame

The source frame for the render-target's projection mapping.

PIXI.Rectangle
viewportFrame

Methods from RenderTextureSystem

void
bind(renderTexture: PIXI.RenderTexture, sourceFrame: PIXI.Rectangle, destinationFrame: PIXI.Rectangle)
void
clear(clearColor: number[], mask: PIXI.BUFFER_BITS)
void
reset()

Resets render-texture state.

Public Properties


clearColor RenderTextureSystem.ts:39
clearColor: number[]

The clear background color as RGBA.

current RenderTextureSystem.ts:48
current: PIXI.RenderTexture | null

Render texture currently bound. null if rendering to the canvas.

defaultMaskStack RenderTextureSystem.ts:42
defaultMaskStack: Array<PIXI.MaskData>

List of masks for the PIXI.StencilSystem.

destinationFrame RenderTextureSystem.ts:61
destinationFrame: PIXI.Rectangle

The destination frame for the render-target's projection mapping.

See PIXI.Projection#destinationFrame for more details.

sourceFrame RenderTextureSystem.ts:54
sourceFrame: PIXI.Rectangle

The source frame for the render-target's projection mapping.

See PIXI.ProjectionSystem#sourceFrame for more details

viewportFrame RenderTextureSystem.ts:68
viewportFrame: PIXI.Rectangle

The viewport frame for the render-target's viewport binding. This is equal to the destination-frame for render-textures, while it is y-flipped when rendering to the screen (i.e. its origin is always on the bottom-left).

Public Methods


bind RenderTextureSystem.ts:92
bind(renderTexture: PIXI.RenderTexture, sourceFrame: PIXI.Rectangle, destinationFrame: PIXI.Rectangle) → {void}

Bind the current render texture.

Parameters:
Name Type Attributes Default Description
renderTexture PIXI.RenderTexture undefined

RenderTexture to bind, by default its null - the screen.

sourceFrame PIXI.Rectangle

<optional>

Part of world that is mapped to the renderTexture.

destinationFrame PIXI.Rectangle

<optional>

Part of renderTexture, by default it has the same size as sourceFrame.

Returns:
Type Description
void
clear RenderTextureSystem.ts:185
clear(clearColor: number[], mask: PIXI.BUFFER_BITS) → {void}

Erases the render texture and fills the drawing area with a colour.

Parameters:
Name Type Attributes Default Description
clearColor number[]

<optional>

The color as rgba, default to use the renderer backgroundColor

mask PIXI.BUFFER_BITS

<optional>

BUFFER_BITS.COLOR | BUFFER_BITS.DEPTH

Bitwise OR of masks that indicate the buffers to be cleared, by default COLOR and DEPTH buffers.

Returns:
Type Description
void
reset RenderTextureSystem.ts:235
reset() → {void}

Resets render-texture state.

Returns:
Type Description
void

Powered by webdoc!