<canvas id="myCanvas" type="2d" style="width: 400px;height: 296px;">
<cover-view class="barrage-textFly">{{item.barrage_shootText}}</cover-view>
</canvas>
无论我的<view>怎么设置,都会被canvas 遮挡,设置成cover-view还是不行
wxml:
.barrage-fly{
position: fixed;
}
.barrage-textFly{
position: fixed;
}
js:
socket.onMessage(function (e) {
var base64 = util.arrayBufferToBase64(e.data);
var img = canvas.createImage();
img.onload = () => {
ctx.drawImage(img,0,0);
};
img.src = base64;
});
工具canvas不支持同层