BackBufferCopy

Inherits:Node2D<CanvasItem<Node<Object

A node that copies a region of the screen to a buffer for access in shader code.

Description

Node for back-buffering the currently-displayed screen. The region defined in theBackBufferCopy node is buffered with the content of the screen it covers, or the entire screen according to thecopy_mode. It can be accessed in shader scripts using the screen texture (i.e. a uniform sampler withhint_screen_texture).

Note: Since this node inherits fromNode2D (and notControl), anchors and margins won't apply to childControl-derived nodes. This can be problematic when resizing the window. To avoid this, addControl-derived nodes assiblings to theBackBufferCopy node instead of adding them as children.

Tutorials

Properties

CopyMode

copy_mode

1

Rect2

rect

Rect2(-100,-100,200,200)


Enumerations

enumCopyMode:🔗

CopyModeCOPY_MODE_DISABLED =0

Disables the buffering mode. This means theBackBufferCopy node will directly use the portion of screen it covers.

CopyModeCOPY_MODE_RECT =1

BackBufferCopy buffers a rectangular region.

CopyModeCOPY_MODE_VIEWPORT =2

BackBufferCopy buffers the entire screen.


Property Descriptions

CopyModecopy_mode =1🔗

Buffer mode. SeeCopyMode constants.


Rect2rect =Rect2(-100,-100,200,200)🔗

The area covered by theBackBufferCopy. Only used ifcopy_mode isCOPY_MODE_RECT.


User-contributed notes

Please read theUser-contributed notes policy before submitting a comment.