[]https://ask.layabox.com/question/13181官方Demo运行不起来

wx.onMessage(function(message){
console.log(message);
if (message.type && message.type == "wxxx")
{
//通过接收主域的消息来设置开发数据域的画布大小跟矩阵信息
sharedCanvas.width = message.width;
sharedCanvas.height = message.height;
console.log("-----------------sharedresize----------1------------------");
console.log(message.data.matrix);
console.log("-----------------sharedresize------------2----------------");
if (message.data.matrix)
{
Laya.stage._canvasTransform = message.data.matrix;//重新设置矩阵
console.log(Laya.stage._canvasTransform);
}
}else if (message['isLoad'] == "filedata") {
//            trace("------------------------filedata-url:" + message.url);
console.log("ddddddddddddddddddddd");
Laya.MiniFileMgr.ziyuFileData[message.url] = message.data;//文本数据
}
});
--------------------------------------------------------------------这里下载xiaosong的Demo,onMessage函数是有错的,判断的是message.data.matrix),而不是 message.matrix,一旦代码改正确,就有错误了。
gameSubContextThirdScriptError
this._canvasTransform.identity is not a function;at requestAnimationFrame callback function
TypeError: this._canvasTransform.identity is not a function
    at Stage.__proto.setScreenSize (http://127.0.0.1:60853/game/su ... 340:33)
    at Stage.__proto._changeCanvasSize (http://127.0.0.1:60853/game/su ... 8309:8)
    at TimerHandler.__proto.run (http://127.0.0.1:60853/game/su ... 816:45)
    at Timer.__proto._update (http://127.0.0.1:60853/game/su ... 573:13)
    at Stage.__proto.render (http://127.0.0.1:60853/game/su ... 499:15)
    at Stage.__proto._loop (http://127.0.0.1:60853/game/su ... 8457:8)
    at Function.loop (http://127.0.0.1:60853/game/su ... 426:15)
    at http://127.0.0.1:60853/game/__ ... 18232
 
 
-------------------------------------------------------------------------
 
已邀请:

w1114367261

赞同来自:

官网的Demo只是给开发者提供的一个思路,具体的实现还是要开发者自行编写的,

要回复问题请先

商务合作
商务合作