Is there a way to convert a graphic to a sprite? I have a graphic containing a single rectangle, and would like to convert it to a sprite to enable complex animations.
I have tried doing
let p= new Graphics();
p.beginFill(0x000000);
p.lineStyle(0);
p.drawCircle(100, 100, 10);
p.endFill();
const t = RenderTexture.create(p.width, p.height);
renderer.render(p, t);
const sprite = new Sprite(t);
However this is not working.