LogoPixi’VN
pixi-jsClasses

Class: SVGDefsCollector

Defined in: node_modules/pixi.js/lib/scene/graphics/shared/svg/buildSVGDefinitions.d.ts:7

Internal

Collects gradient/pattern definitions encountered during SVG export. After all elements are processed, call build() to emit the <defs> block.

Constructors

Constructor

> new SVGDefsCollector(): SVGDefsCollector

Returns

SVGDefsCollector

Methods

addStyle()

> addStyle(style): string | null

Defined in: node_modules/pixi.js/lib/scene/graphics/shared/svg/buildSVGDefinitions.d.ts:15

Registers a gradient from a fill/stroke style and returns a url(#id) reference. If the style has no gradient, returns null.

Parameters

style

ConvertedFillStyle

Returns

string | null


build()

> build(): string

Defined in: node_modules/pixi.js/lib/scene/graphics/shared/svg/buildSVGDefinitions.d.ts:17

Renders the collected definitions as an SVG <defs> string.

Returns

string