小游戏画布对象的方法是哪来的?

小游戏 企业微信 微信支付 小程序 文章 2020-07-30 20:37 584 0 全屏看文

AI助手支持GPT4.0

小游戏画布对象的方法是哪来的?

小游戏开发疑问:

小游戏官方示例中有一个适配文件weapp-adapter.js

举个例子:

import './js/libs/weapp-adapter'

let ctx = canvas.getContext('2d')

。。。

ctx.strokeStyle = "#000000";

。。。

比如这个strokeStyle 方法,小游戏开发文档里没有,weapp-adapter.js中也没有,我想知道类似好多的画布相关的方法这都是哪来的?小程序开发文档倒是有相关方法比如setStrokeStyle但是小游戏环境并不能用,我估计应该是小游戏canvas对象自带的,官方文档咋不写呀?


Small game development question: the official example of small game has an adaptation file, weapp- adapter.js For example: import '. / JS / LIBS / weapp adapter' let CTX= canvas.getContext ('2d') 。。。 ctx.strokeStyle = "#000000"; 。。。 For example, the strokestyle method is not included in the game development document- adapter.js I want to know how many canvas related methods come from? There are relevant methods for developing small programs, such as setstrokestyle. But the small game environment can't be used. I guess it should be brought by the canvas object. Why don't you write the official documents?

回答:

Forever:

和HTML5的canvas对象使用方法一样

-EOF-

AI助手支持GPT4.0