new PIXI.GraphicsFormat()
GraphicsFormat.js, line 1
Parse or serialize PIXI.Graphics objects with *.pgf files.
Example
const app = new PIXI.Application();
const graphics = PIXI.GraphicsFormat.parse("f #f00 dr 30 10 100 150 c");
app.stage.addChild(graphics);
Members
-
static,readonlyPIXI.GraphicsFormat.COMMANDSObject
-
The aliases for draw commands
Properties:
Name Type Description cstring Alias for method
closePathhstring Alias for method
addHolemstring Alias for method
moveTolstring Alias for method
lineToqstring Alias for method
quadraticCurveTobstring Alias for method
bezierCurveTofstring Alias for method
beginFillsstring Alias for method
lineStyledrstring Alias for method
drawRectrrstring Alias for method
drawRoundedRectrcstring Alias for method
drawRoundedRectdcstring Alias for method
drawCirclearstring Alias for method
arcatstring Alias for method
arcTodestring Alias for method
drawEllipse
Methods
-
staticPIXI.GraphicsFormat.parse(contents, graphics){PIXI.Graphics}
GraphicsFormat.js, line 59 -
Parse a string as a Graphics Object
Name Type Description contentsstring Commands to draw
graphicsPIXI.Graphics optional Graphics object to use, if none is supplied will create new object.
Throws:
-
Throws error if contents is not well formatted
- Type
- SyntaxError
Returns:
Type Description PIXI.Graphics New graphics object created -
-
staticPIXI.GraphicsFormat.stringify(graphics){string}
GraphicsFormat.js, line 69 -
Convert the graphic to a string
Name Type Description graphicsPIXI.Graphics Object to convert to string
Returns:
Type Description string Graphic serialized as string