# frame-animation-canvas

> A Frame Animation implementation Based on HTML5 Canvas

Latest version **0.1.1** (published 2017-07-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install frame-animation-canvas
pnpm add frame-animation-canvas
yarn add frame-animation-canvas
bun add frame-animation-canvas
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2017-07-21 |
| First published | 2017-07-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | iconie |
| Maintainers | aircloud |
| Keywords | canvas |

## Links

- npm: https://www.npmjs.com/package/frame-animation-canvas
- Repository: https://github.com/aircloud/FrameAnimationCanvas
- Homepage: https://github.com/aircloud/FrameAnimationCanvas#readme
- Issues: https://github.com/aircloud/FrameAnimationCanvas/issues
- npm.io page: https://npm.io/package/frame-animation-canvas

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2017-07-21
- 0.0.4 — 2017-07-16
- 0.0.3 — 2017-07-16

## README

##  一种基于canvas的帧动画实现

*beta*

>The English edition of instruction is edited and is to be published soon

### 使用

```
npm i frame-animation-canvas --save
```

然后可以直接:

```
var frameAnimationCanvas = require("frame-animation-canvas");
//...
var ani = frameAnimationCanvas("frameResult.png",$theDomNode,ArrayFromJsonResult,60,1.15);
ani.begin();
```

默认引入的是babel编译好的ES5版本，无需进行编译即可使用。

源文件在src文件夹下，也可以直接拷贝源文件进行使用。

另外值得注意的是，素材需要由[Egret Texture Merger](http://developer.egret.com/cn/github/egret-docs/tools/TextureMerger/manual/index.html)这个工具生成，也可参考[这里](https://zhuanlan.zhihu.com/p/27915958)

### 构造函数参数列表

| 属性 | 是否必须 | 默认值 | 描述 | 类型 |
| ------| ------ | ------ | ------ | ------ | 
| imgSrc | 必须 | null | 所有帧的合成图片地址 | png/jpg |
| canvasDom | 必须 | null | canvas对应的实际dom元素 | DOM |
| positionInfo | 必须 | null | [Egret Texture Merger](http://developer.egret.com/cn/github/egret-docs/tools/TextureMerger/manual/index.html)生成的结果frames属性内容(转化成array) | array |
| interFrameTime | 必须 | null | 帧间隔 | Number |

>注意：由于之前的scale参数可能会出现问题，现在已经删除scale参数，建议直接控制canvas的大小来实现缩放功能。

### 协议
MIT

---
_Source: https://npm.io/package/frame-animation-canvas · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
