// 点击分享按钮
shareClicked:function() {
if (cc.sys.platform === cc.sys.WECHAT_GAME) {
var openDataContext = wx.getOpenDataContext()
var sharedCanvas = openDataContext.canvas
if (sharedCanvas) {
cc.log ("分享的面板存在")
}
var canvas = wx.createCanvas()
var context = canvas.getContext('2d')
context.drawImage(sharedCanvas, 0, 0)
cc.log ("微信分享")
}
},
在使用cocos creator开发小游戏时,如何自定义...按钮点击之后的弹出菜单--微信小程序开发。需要获取些用户信息来制作排行版,根据提供的 https://mp.weixin.qq.com/debug/wxagame/dev/tutorial/open-ability/open-data.html?t=2018323 中的教程,主域和开放数据域的相关配置已经配置完成,但最后需要调用时却给出这样的提示:
An unsecure canvas can't take an secure canvas as arugment of drawImage When using subcontext
本文网址:http://www.91bianli.com/kaifazhinan/70340.html