Instead of drawing everything in one Graphics object, make a new child Graphics object for each SVG element.
This would result in a Pixi scene graph tree, which would make it possible to traverse the tree and apply translations, rotations, etc, to individual Graphics objects, just like working with any existing Pixi tree.
Currently, if one wants to animate something, they have to re-render the whole SVG each tick, which is much more expensive than (for example) finding a sub-node and modifying only that sub-node.
You've got the drawing commands mapped, you just need create the child Graphics objects, then apply the same drawing commands in the child Graphics.
Basically, instead of rendering all commands into the Graphics object passed into SVGGraphics.drawSVG, you would add children to that Graphics object, and apply commands to each child corresponding to each SVG elements, and etcetera for children of those children.
The result would be a tree that is similar in structure to the SVG DOM tree.
Instead of drawing everything in one Graphics object, make a new child Graphics object for each SVG element.
This would result in a Pixi scene graph tree, which would make it possible to traverse the tree and apply translations, rotations, etc, to individual Graphics objects, just like working with any existing Pixi tree.
Currently, if one wants to animate something, they have to re-render the whole SVG each tick, which is much more expensive than (for example) finding a sub-node and modifying only that sub-node.
You've got the drawing commands mapped, you just need create the child Graphics objects, then apply the same drawing commands in the child Graphics.
Basically, instead of rendering all commands into the Graphics object passed into
SVGGraphics.drawSVG
, you would add children to that Graphics object, and apply commands to each child corresponding to each SVG elements, and etcetera for children of those children.The result would be a tree that is similar in structure to the SVG DOM tree.