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.
Name | Type | Description |
---|---|---|
paintServer | SVGGradientElement | SVGPatternElement | |
paintTexture | PIXI.RenderTexture |
Summary
Methods from PaintServer
void |
|
void |
|
void |
Renders the paint texture using the renderer immediately. |
Public Methods
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.
Name | Type | Description |
---|---|---|
renderer | PIXI.Renderer |
The renderer that will use the paint texture. |
Type | Description |
---|---|
void |
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.
Name | Type | Description |
---|---|---|
bbox | PIXI.Rectangle |
The bounding box of the object applying the paint texture. |
Type | Description |
---|---|
void |
updatePaint(renderer: PIXI.Renderer) → {void}
Renders the paint texture using the renderer immediately.
Name | Type | Description |
---|---|---|
renderer | PIXI.Renderer |
The renderer to use for rendering to the paint texture. |
Type | Description |
---|---|
void |