官方的例子是基于原生的啊,如何在pixi引擎做离屏渲染呢。。。
主域代码:
let openDataContext = wx.getOpenDataContext();
let scanvas = openDataContext.canvas;
scanvas.width = this.UI.bg.width;
scanvas.height = this.UI.bg.height;
let btexture = new PIXI.BaseTexture(scanvas);
let sprite = new PIXI.Sprite(new PIXI.Texture(btexture));
sprite.anchor.set(0.5);
this.UI.scene.addChild(sprite);
子域:
let sharedCanvas = wx.getSharedCanvas()
let context = sharedCanvas.getContext(‘2d’)
context.fillStyle = ‘red’
context.fillRect(0, 0, 100, 100)
无法实现渲染。。。