// Create a new app (will auto-add extract plugin to renderer)
const app = new PIXI.Application();
// Draw a red circle
const graphics = new PIXI.Graphics()
.beginFill(0xFF0000)
.drawCircle(0, 0, 50);
// Render the graphics as an HTMLImageElement
const image = app.renderer.plugins.extract.image(graphics);
document.body.appendChild(image);
直接调用canvas的toDataURL();将会导出一个透明的图片。
需要调用renderer的plugin里面的extract进行导出