Skip to content

Graphics

Creates a Graphics

Graphics can be used for any kind of drawing. Use the effect event to interact with the Graphics API.

This will set up a watchEffect internally that will automatically call the event handler again if any dependencies on the render method have changed.

API

Graphics Attributes

NameTypeDefaultDescription
blend-mode

number BLEND_MODES

'normal'The blend mode to be applied to the sprite.
tint

string|number|array|object

undefinedThe tint applied to the graphic shape.
is-maskbooleanfalseSets if this Graphics object is a mask.

more props in Container Attributes and Graphics

Graphics Events

NameTypeDescription
effectfunctionCall your drawing functions on the Graphics instance here

more events in Container Events

Graphics Slots

NameDescription
defaultThe default slot is used to render the children of the Graphics element.