Skip to main content

VGNode

Description:

  A node for rendering vector graphics.

Class Object: VGNode Class.

Inherits from: Node.

surface

Type: Readonly Field.

Description:

  The surface of the node for displaying frame buffer texture that contains vector graphics. You can get the texture of the surface by calling vgNode.surface.texture.

Signature:

const surface: Sprite

render

Type: Function.

Description:

  The function for rendering vector graphics.

Signature:

render: function(self: VGNode, func: function())

Usage:

vgNode:render(function()
nvg.BeginPath()
nvg.Rect(0, 0, 100, 100)
nvg.ClosePath()
nvg.FillColor(Color(255, 0, 0, 255))
nvg.Fill()
end)

Parameters:

ParameterTypeDescription
funcfunctionThe closure function for rendering vector graphics.You can do the rendering operations inside this closure.