Class FramebufferSystem

System plugin to the renderer to manage framebuffers.

Memberof

PIXI

Implements

Constructors

  • Parameters

    • renderer: Renderer

      The renderer this System works for.

    Returns FramebufferSystem

Properties

current: Framebuffer
hasMRT: boolean
managedFramebuffers: Framebuffer[]

A list of managed framebuffers.

renderer: Renderer
viewport: Rectangle
writeDepthTexture: boolean

Accessors

  • get size(): {
        height: number;
        width: number;
        x: number;
        y: number;
    }
  • Get the size of the current width and height. Returns object with width and height values.

    Returns {
        height: number;
        width: number;
        x: number;
        y: number;
    }

    • height: number
    • width: number
    • x: number
    • y: number

Methods

  • Bind a framebuffer.

    Parameters

    • Optional framebuffer: Framebuffer
    • Optional frame: Rectangle

      frame, default is framebuffer size

    • Optional mipLevel: number

      optional mip level to set on the framebuffer - defaults to 0

    Returns void

  • Only works with WebGL2

    blits framebuffer to another of the same or bigger size after that target framebuffer is bound

    Fails with WebGL warning if blits multisample framebuffer to different size

    Parameters

    • Optional framebuffer: Framebuffer

      by default it blits "into itself", from renderBuffer to texture.

    • Optional sourcePixels: Rectangle

      source rectangle in pixels

    • Optional destPixels: Rectangle

      dest rectangle in pixels, assumed to be the same as sourcePixels

    Returns void

  • Clear the color of the context

    Parameters

    • r: number

      Red value from 0 to 1

    • g: number

      Green value from 0 to 1

    • b: number

      Blue value from 0 to 1

    • a: number

      Alpha value from 0 to 1

    • Optional mask: BUFFER_BITS

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

    Returns void

  • Generic destroy methods to be overridden by the subclass

    Returns void

  • Disposes all framebuffers, but not textures bound to them.

    Parameters

    • Optional contextLost: boolean

      If context was lost, we suppress all delete function calls

    Returns void

  • Disposes framebuffer.

    Parameters

    • framebuffer: Framebuffer

      framebuffer that has to be disposed of

    • Optional contextLost: boolean

      If context was lost, we suppress all delete function calls

    Returns void

  • Resets framebuffer stored state, binds screen framebuffer. Should be called before renderTexture reset().

    Returns void

  • Set the WebGLRenderingContext's viewport.

    Parameters

    • x: number

      X position of viewport

    • y: number

      Y position of viewport

    • width: number

      Width of viewport

    • height: number

      Height of viewport

    Returns void

Generated using TypeDoc