Skip to main content

Pixi Graphics

This node creates vector graphics shapes using PIXI.Graphics. It supports various shapes and drawing commands.

The Pixi Graphics creates vector shapes and graphics in your Pixi scene.

The Pixi Graphics node creates a PIXI.Graphics object that can draw various vector shapes and graphics. It's perfect for creating geometric shapes, custom graphics, and dynamic visual elements in your Pixi scene.

Inputs

Position

DataDescription
XHorizontal position
YVertical position

Transform

DataDescription
RotationRotation in radians
Scale XHorizontal scale
Scale YVertical scale
Pivot XHorizontal pivot
Pivot YVertical pivot

Appearance

DataDescription
AlphaTransparency
TintColor tint
VisibleVisibility
InteractiveInteraction enable
Blend ModeRendering blend mode

Simple Shape

DataDescription
ShapeShape type (rect, circle, polygon)
Fill ColorFill color
Fill AlphaFill transparency
Line WidthStroke width
Line ColorStroke color
Line AlphaStroke transparency

Rectangle

DataDescription
WidthRectangle width
HeightRectangle height

Circle

DataDescription
RadiusCircle radius

Polygon

DataDescription
PointsArray of polygon points [x,y,x,y...]

Drawing

DataDescription
Drawing CommandsJSON array of drawing commands

Actions

SignalDescription
ClearClears all graphics

Filters

DataDescription
Enable BlurBlur filter
Blur AmountBlur intensity
Enable Color MatrixColor matrix filter
Enable DisplacementDisplacement filter

Animation

DataDescription
Ticker EnabledAnimation ticker
Ticker SpeedAnimation speed
Animation TypeAnimation type
Custom Animation CodeCustom animation code

Outputs

SignalDescription
Pointer DownTriggered when pointer is pressed down
Pointer UpTriggered when pointer is released
Pointer TapTriggered when pointer taps the graphics
Pointer EnterTriggered when pointer enters the graphics
Pointer LeaveTriggered when pointer leaves the graphics
Pointer MoveTriggered when pointer moves over the graphics
DataDescription
Actual WidthGraphics width
Actual HeightGraphics height
Node ReferenceNode reference

Usage

Pixi Graphics nodes are used to create vector graphics and shapes in your Pixi scene. They support:

  • Basic geometric shapes (rectangles, circles, polygons)
  • Custom drawing commands
  • Fill and stroke styling
  • Interactive events
  • Animation capabilities

Drawing Commands

For complex graphics, you can use the Drawing Commands input with a JSON array of commands:

[
{"type": "beginFill", "color": 0xFF0000, "alpha": 1},
{"type": "drawRect", "x": 0, "y": 0, "width": 100, "height": 100},
{"type": "endFill"},
{"type": "lineStyle", "width": 2, "color": 0x000000},
{"type": "drawCircle", "x": 50, "y": 50, "radius": 25}
]

Performance Tips

  • Use simple shapes when possible for better performance
  • Clear graphics when no longer needed
  • Limit the number of complex drawing commands
  • Use appropriate Line Width for your display needs
  • Consider using sprites for complex graphics that don't change

Example Use Cases

  1. UI Elements: Buttons, progress bars, and interface graphics
  2. Game Graphics: Health bars, power meters, and visual effects
  3. Data Visualization: Charts, graphs, and diagrams
  4. Decorative Elements: Background patterns and artistic graphics