PaintServer

class PaintServer

Paint Servers are implemented as textures. This class is a lazy wrapper around paint textures, which can only be generated using the renderer drawing to the screen.

Constructor


new PaintServer(paintServer: SVGGradientElement | SVGPatternElement, paintTexture: PIXI.RenderTexture) → {}

Creates a PaintServer wrapper.

Parameters:
Name Type Description
paintServer SVGGradientElement | SVGPatternElement
paintTexture PIXI.RenderTexture

Summary


Methods from PaintServer

void
resolvePaint(renderer: PIXI.Renderer)
void
resolvePaintDimensions(bbox: PIXI.Rectangle)
void
updatePaint(renderer: PIXI.Renderer)

Renders the paint texture using the renderer immediately.

Public Methods


resolvePaint PaintServer.ts:49
resolvePaint(renderer: PIXI.Renderer) → {void}

Ensures the paint texture is updated for the renderer's WebGL context. This should be called before using the paint texture to render anything.

Parameters:
Name Type Description
renderer PIXI.Renderer

The renderer that will use the paint texture.

Returns:
Type Description
void
resolvePaintDimensions PaintServer.ts:67
resolvePaintDimensions(bbox: PIXI.Rectangle) → {void}

Calculates the optimal texture dimensions for the paint texture, given the bounding box of the object applying it. The paint texture is resized accordingly.

If the paint texture is sized smaller than the bounding box, then it is expected that it will be scaled up to fit it.

Parameters:
Name Type Description
bbox PIXI.Rectangle

The bounding box of the object applying the paint texture.

Returns:
Type Description
void
updatePaint PaintServer.ts:129
updatePaint(renderer: PIXI.Renderer) → {void}

Renders the paint texture using the renderer immediately.

Parameters:
Name Type Description
renderer PIXI.Renderer

The renderer to use for rendering to the paint texture.

Returns:
Type Description
void

Powered by webdoc!