这个 我知道 但问题是如果没提示的话 后面用ctx还有一大堆的代码 不可能完全都记得
追答看 W3C 官方网站上的标准。里面有 API 接口说明。附录中是网址。
像下面这样的内容。
interface CanvasRenderingContext2D {
// back-reference to the canvas
readonly attribute HTMLCanvasElement canvas;
// state
void save(); // push state on state stack
void restore(); // pop state stack and restore state
// transformations (default transform is the identity matrix)
... 还有更多.