bigtimebuddy / pixi-svg

SVG to Graphics DisplayObject for pixi.js

Home Page:https://npmjs.com/pixi-svg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Changing Fill Color after element rendered

khanzzirfan opened this issue · comments

Hi, How to change the SVG fill and stroke after object rendered? tried this way but didn't update any fill color.

svgObject.beginFill(0xf1c40f)
svgObject.endFill();

https://codesandbox.io/s/pixijs-examples-events-hit-test-forked-f9ttqe

This is a limitation of Graphics in Pixi. There's no way to modify the fill color after drawing. You have to redraw the shape. Optionally, you can use tint, but that may not render what you want.