Make WeChat game screenshot with cocos crae

Reference document: https://developers.weixin.qq.com/minigame/dev/document/render/canvas/Canvas.toTempFilePathSync.html


Core code:

var canvas = cc.game.canvas; var width = cc.winSize.width; var height = cc.winSize.height; canvas.toTempFilePath({ x : 0, y: 0, width: width, height: height, destWidth: width, destHeight: height , success (res) {//. The screenshot can be saved console.log(res) wx. shareAppMessage({ imageUrl: res.tempFilePath })} }) // let tempFilePath = canvas.toTempFilePathSync({ // x : 0, // y: 0, // width: width,  // height: height, // destWidth: width, // destHeight: height < span class="hljs-comment">// }) // wx.shareAppMessage({ // imageUrl: tempFilePath // })

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 3710 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.