# tinyjs-plugin-dust

> Dust is a quick and easy particle effects engine

Latest version **0.3.0** (published 2021-01-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install tinyjs-plugin-dust
pnpm add tinyjs-plugin-dust
yarn add tinyjs-plugin-dust
bun add tinyjs-plugin-dust
```

## 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.3.0 |
| Published | 2021-01-04 |
| First published | 2017-05-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 29.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | yiiqii |
| Maintainers | yiqi |
| Keywords | tinyjs, plugin |

## Links

- npm: https://www.npmjs.com/package/tinyjs-plugin-dust
- Repository: https://github.com/ant-tinyjs/tinyjs-plugin-dust
- Homepage: https://github.com/ant-tinyjs/tinyjs-plugin-dust#readme
- Issues: https://github.com/ant-tinyjs/tinyjs-plugin-dust/issues
- npm.io page: https://npm.io/package/tinyjs-plugin-dust

## Recent versions

- 0.3.0 (latest) — 2021-01-04
- 0.2.0 — 2019-12-24
- 0.1.6 — 2019-02-19
- 0.1.5 — 2019-01-22
- 0.1.4 — 2019-01-17
- 0.1.3 — 2019-01-15
- 0.1.2 — 2019-01-15
- 0.1.1 — 2019-01-15
- 0.1.0 — 2018-11-30
- 0.0.6 — 2017-11-15
- 0.0.3 — 2017-06-01
- 0.0.2 — 2017-05-31

## README

# tinyjs-plugin-dust

> Dust is a quick and easy particle effects engine

## 查看demo

http://tinyjs.net/plugins/tinyjs-plugin-dust.html#demo

## 引用方法

- 推荐作为依赖使用

  - `npm install tinyjs-plugin-dust --save`

- 也可以直接引用线上cdn地址，注意要使用最新的版本号，例如：

  - https://gw.alipayobjects.com/os/lib/tinyjs-plugin-dust/0.3.0/index.js
  - https://gw.alipayobjects.com/os/lib/tinyjs-plugin-dust/0.3.0/index.debug.js

## 起步
首先当然是要引入，推荐`NPM`方式，当然你也可以使用`CDN`或下载独立版本，先从几个例子入手吧！

##### 1、最简单的例子

引用 Tiny.js 源码
``` html
<script src="https://gw.alipayobjects.com/os/lib/tinyjs/tiny/1.5.0/tiny.js"></script>
```
``` js
var Dust = require('tinyjs-plugin-dust');
// 或者
// import Dust from 'tinyjs-plugin-dust';

// 新建 APP
var app = new Tiny.Application({
  width: 320,
  height: 320
});
// 创建容器
var container = new Tiny.Container();
// 初始化
var dust = new Dust(100, 100, function () {
    return new Tiny.Sprite.fromImage('https://gw.alipayobjects.com/as/g/tiny/resources/1.0.0/images/heart.png')
  }, container,
  {
    number: 50,
    gravity: 0.1,
    randomSpacing: true,
    minAngle: 0, maxAngle: 6.28,
    minSize: 12, maxSize: 24,
    minSpeed: 1, maxSpeed: 2,
    minScaleSpeed: 0.005, maxScaleSpeed: 0.01,
    minAlphaSpeed: 0.005, maxAlphaSpeed: 0.01,
    minRotationSpeed: 0.05, maxRotationSpeed: 0.1
  });

app.run(container);
app.onUpdate(function () {
  dust && dust.update();
});
```

## 依赖
- `Tiny.js`: [Link](http://tinyjs.net/api)

## API文档

http://tinyjs.net/plugins/tinyjs-plugin-dust.html#docs

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