https://github.com/ospoon/canvas2d-ts
面向对象使用 Canvas2D,采用链式调用的方式更加适合熟悉原生 canvas 相关 API
https://github.com/ospoon/canvas2d-ts
Last synced: 11 months ago
JSON representation
面向对象使用 Canvas2D,采用链式调用的方式更加适合熟悉原生 canvas 相关 API
- Host: GitHub
- URL: https://github.com/ospoon/canvas2d-ts
- Owner: OSpoon
- Created: 2021-06-18T02:08:27.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-06-19T07:47:05.000Z (almost 5 years ago)
- Last Synced: 2025-05-19T05:05:48.298Z (about 1 year ago)
- Language: TypeScript
- Size: 63.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## Canvas2D-TS
> 面向对象使用 Canvas2D,采用链式调用的方式更加适合熟悉原生 canvas 相关 API
##### 示例
```html
import { Canvas2D } from "../dist/canvas2d.js";
let canvas2d = new Canvas2D("#app");
canvas2d
.initStyle()
.setStrokeStyle("#555")
.end()
.initRect()
.setLTPoint(0, 0)
.setRBPoint(100, 100)
.buildRectPath()
.stroke();
```
##### 提示:
> 在vscode中安装Live Server插件来启动test中的index.html文件进行预览