Skip to content
Marc Flerackers edited this page Jun 9, 2024 · 1 revision

The drawon component is used to render a tree partly in a framebuffer.

const offscreen = makeCanvas(200, 200)

add([
  drawon(offscreen)
])

It can be used to pre-render something so it doesn't need to be redrawn each frame. Another usage is multipass shaders.

One problem with the component is that it renders both the node as well as its children in the framebuffer, but it doesn't use a stack. So if a child also uses drawon, things might get problematic.

The same problem happens with nested mask components.

Clone this wiki locally