Graphics is the vector-drawing leaf of the PixiJS v8 scene graph. The v8 API follows a shape-then-style pattern: draw a shape or path with rect , circle , moveTo , etc., then apply fill and/or stroke . Every method returns this for chaining, and the drawing instructions live on a GraphicsContext that can be shared between instances. Assumes familiarity with pixijs-scene-core-concepts . Graphics is a leaf: do not nest children inside it. Wrap multiple Graphics objects in a Container to group them. Quick Start const g = new Graphics ( ) ; g . rect ( 10 , 10 , 200 , 100 ) . fill ( { color : 0x3498db , alpha : 0.8 } ) . stroke ( { width : 3 , color : 0x2c3e50 } ) ; g . circle ( 300 , 60 , 40 ) . fill ( 0xe74c3c ) ; g . moveTo ( 50 , 200 ) . lineTo ( 200 , 200 ) . bezierCurveTo ( 250 , 250 , 100 , 300 , 50 , 250 ) . closePath ( ) . fill ( 0x6c5ce7 ) ; app . stage . addChild ( g ) ;
pixijs-scene-graphics
安装
npx skills add https://github.com/pixijs/pixijs-skills --skill pixijs-scene-graphics