Provide the necessary methods to get a snapshot of the framebuffer into a render texture. Class meant to be used as a singleton. Created with the precious advices of dev7355608.

Properties

framebufferTexture: RenderTexture

The RenderTexture that is the render destination for the framebuffer snapshot.

#hasResized: boolean = true

To know if we need to update the texture.

#tempSourceFrame: Rectangle = ...

A placeholder for temporary copy.

Methods

  • Get the framebuffer texture snapshot.

    Parameters

    • renderer: Renderer

      The renderer for this context.

    Returns RenderTexture

    The framebuffer snapshot.

  • Create a render texture, provide a render method and an optional clear color.

    Returns RenderTexture

    A reference to the created render texture.