华为手机使用canvas.getContext('2d')真机黑屏

小游戏 企业微信 微信支付 小程序 文章 2020-07-30 21:01 1120 0 全屏看文

AI助手支持GPT4.0

华为手机使用canvas.getContext('2d')真机黑屏
框架类型 问题类型 终端类型 微信版本 基础库版本
小游戏 Bug 微信安卓客户端 7.0.16 2.11.3

var canvas = wx.createCanvas();

var context = canvas.getContext('2d');

context.fillStyle =  '#1aad19' 

context.fillRect(0,0,100,200);


在game.js文件中输入这些,电脑上可以显示,真机黑屏不能显示。手机型号:POT-AL100,华为手机麦芒8.

Framework type problem type terminal type wechat version basic library version games bug wechat Android client 7.0.16 2.11.3 var canvas= wx.createCanvas (); var context = canvas.getContext ('2d'); context.fillStyle = '#1aad19' context.fillRect (0,0100200); in game.js Input these files, the computer can display, the real machine black screen can not display. Mobile phone model: pot-al100, Huawei mobile phone maimang 8. Code fragment var canvas= wx.createCanvas (); var context = canvas.getContext ('2d'); context.fillStyle = '#1aad19' context.fillRect (0,0,100,200);

回答:

Forever:

有调用帧循环吗?

funcell:game.js中只有以上几行代码。
funcell:这都不行,谈何调用帧循环
Forever:安卓手机需要调用帧循环才能显示出来的

-EOF-

AI助手支持GPT4.0