Hi there!
I'm migrating my engine from v4 to v5, but I am having problems using a graphics object as a texture.
Any ideas?
const graphics = new PIXI.Graphics();
graphics.lineStyle(
backgroundStyle.strokeWidth,
backgroundStyle.strokeColor,
backgroundStyle.strokeOpacity
);
graphics.beginFill(BACKGROUND_COLOR, BACKGROUND_OPACITY);
graphics.drawRoundedRect(
ZERO,
ZERO,
width,
height,
NODE_CORNER_RADIUS
);
graphics.endFill();
const texture = graphics.generateCanvasTexture();
sprite.texture = texture;
But now I don't know how to get the texture from graphics since I am trying not to use the legacy version for pixi.