Closed zhuhang4 closed 4 years ago
Graphics对象也是用canvas实现的,小程序内不能动态使用canvas,如果需要使用到这个功能,可以在小程序内放置一个type 2d的canvas,把东西draw到画布上,然后Canvas.toDataURL生成图片,然后PIXI加载这个图片显示出来。
更新了一个版本,wxml文件中引入一个type 2d的canvas,wxss文件把该canvas位置放到屏幕外,通过PIXI = createPIXI(canvas,stageWidth,canvas2d);注入到PIXI引擎中,详细做法参考example
了解了,感谢回复!
var red=new PIXI.Graphics(); red.beginFill(0xff0000,1); red.drawRect(0,0,100,100); stage.addChild(red);
报错:Failed to execute 'texImage2D' on 'WebGLRenderingContext': No function was found that matched the signature provided.;