Skip to content

Commit

Permalink
add proton-engine version v4.0.0
Browse files Browse the repository at this point in the history
add proton-engine version v4.0.0
  • Loading branch information
drawcall committed Nov 8, 2019
1 parent 494ee20 commit 8f024ba
Show file tree
Hide file tree
Showing 215 changed files with 9,049 additions and 8,295 deletions.
Empty file modified .babelrc
100644 → 100755
Empty file.
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
insert_final_newline = false
trim_trailing_whitespace = false
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist
build
example
35 changes: 35 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,42 @@
# IDEs and editors
.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# next.js build output
.next

# Lerna
lerna-debug.log

# System Files
.DS_Store
Thumbs.db

# node modules
node_modules

# documentation
build/docs/

package-lock.json
.DS_Store
source/build/
Empty file modified .npmignore
100644 → 100755
Empty file.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License

Copyright © 2010-2019 Proton authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
92 changes: 62 additions & 30 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,25 +1,48 @@
# Proton
<div align=center><img src="https://a-jie.github.io/Proton/images/logo/proton.png"/></div>

> See the detailed documentation please visit [here](https://projects.jpeer.at/proton/)
---

Proton is a lightweight and powerful javascript particle engine. With it you can easily create countless cool effects.
#### Check out examples at: [http://a-jie.github.io/Proton/](http://a-jie.github.io/Proton/). Check out the tutorial at: [https://qiita.com/matsu7089/items/dcb7d326e4ec1340eba6](https://qiita.com/matsu7089/items/dcb7d326e4ec1340eba6)
<div align="center">
<a href='https://www.npmjs.com/package/proton-engine'>
<img src='https://badge.fury.io/js/proton-engine.svg' alt='npm version' height='18'>
</a>

<a href='https://github.com/a-jie/Proton/issues'>
<img src='https://img.shields.io/github/issues/a-jie/Proton.svg' alt='issues open' height='18'>
</a>

<a href='#'>
<img src='https://img.shields.io/npm/l/Proton.svg' alt='license:MIT' height='18'>
</a>

</div>


Proton is a lightweight and powerful Javascript particle animation library. Use it to easily create a variety of cool particle effects.

Check out examples at [http://a-jie.github.io/Proton/](http://a-jie.github.io/Proton/). The **3D version** of the proton engine is here [https://a-jie.github.io/three.proton/](https://a-jie.github.io/three.proton/)

## Features
- Seven kinds of renderers
- canvas - CanvasRenderer
- dom - DomRenderer
- webgl - WebGLRenderer
- pixel - PixelRenderer
- easeljs - EaselRenderer
- pixi.js - PixiRenderer
- custom - CustomRenderer
- Create cool effects like the demo of [71squared's ParticleDesigner](https://www.71squared.com/particledesigner) in 10 lines of code.
- Integratable into any game engine.
- Veriety of behaviors which can simulate many different physical effects.
- Three kinds of emitters and can be easily expanded.
- The __3D version__ of the proton engine is here [https://a-jie.github.io/three.proton/](https://a-jie.github.io/three.proton/)

- **Easy to use** It takes only a dozen lines of code to create a particle animation effect.
- **Multiple effects** Use Proton to create flames, fireworks, bullets, explosions, and more.
- **Any scene** You can use it in frameworks such as `react`, `vue`, `angular`, and `pixi.js`, `Phaser`, etc.
- **Efficient rendering** Its rendering efficiency is very high, you can render tens of thousands of particles in the page.
- **Simulated physics** Proton can simulate various physical properties including gravity and Brownian motion.
- **Several renderers** Proton provides a variety of renderers, of course you can also customize your own renderer
- `CanvasRenderer` - Proton's canvas renderer
- `DomRenderer` - Proton's dom renderer, supporting hardware acceleration.
- `WebGLRenderer` - Proton's webgl renderer.
- `PixelRenderer` - Proton's pixel renderer, It can implement pixel animation.
- `EaselRenderer` - Easeljs proton renderer.
- `EaselRenderer` - Pixi.js proton renderer.
- `CustomRenderer` - Use a custom renderer that can be applied to any scene.

## Documentation

See detailed documentation please visit [https://projects.jpeer.at/proton/](https://projects.jpeer.at/proton/).
Thank you very much [@matsu7089](https://github.com/matsu7089) for writing a [good tutorial](https://qiita.com/matsu7089/items/dcb7d326e4ec1340eba6).


## Installation

Expand All @@ -28,9 +51,11 @@ Proton is a lightweight and powerful javascript particle engine. With it you can

##### Note: NPM package-name has been changed from `proton-js` to `proton-engine`

```
```shell
npm install proton-engine --save
...
```

```javascript
import Proton from 'proton-engine';
```

Expand All @@ -40,9 +65,12 @@ import Proton from 'proton-engine';
```

## Usage

Proton is very simple to use, a dozen lines of code can create a particle animation.

```javascript
var proton = new Proton();
var emitter = new Proton.Emitter();
const proton = new Proton();
const emitter = new Proton.Emitter();

//set Rate
emitter.rate = new Proton.Rate(Proton.getSpan(10, 20), 0.1);
Expand All @@ -67,28 +95,32 @@ proton.addEmitter(emitter);
// add canvas renderer
var renderer = new Proton.CanvasRenderer(canvas);
proton.addRenderer(renderer);

//use Euler integration calculation is more accurate (default false)
Proton.USE_CLOCK = false or true;
```

## Description
`Proton.Span (or Proton.getSpan)` is a very important concept of the Proton engine, it's everywhere. If you understand its usage, you can create almost any desired effect!
Proton has now been upgraded to the __v3__ version. Performance has been greatly improved and api also has some improvements. For more details, please check [here](https://github.com/a-jie/Proton/releases).
## Remarks
* `Proton.Span (or Proton.getSpan)` is a very important concept of the Proton engine, it's everywhere. If you understand its usage, you can create almost any desired effect!

* If you want to create wind, rain, or snow, etc, you can use the `emitter.preEmit` method to pre-render the scene.

* Use `Proton.Body` and `Proton.Color` at the same time. I suggest you'd better use the `WebGLRenderer` not `CanvasRenderer`.

* Use Euler integration calculation is more accurate (default false) `Proton.USE_CLOCK = false or true;`

Proton has now been upgraded to the __v4__ version. Performance has been greatly improved and api also has some improvements. For more details, please check [here](https://github.com/a-jie/Proton/releases).

## Building
Node is a dependency, use terminal to install it with:

`node` is a dependency, use terminal to install it with:

```javascript
git clone git://github.com/a-jie/Proton.git

...
npm install
npm run build
```

and run example
And run example

```javascript
npm start
Expand Down
Empty file modified bower.json
100644 → 100755
Empty file.
Loading

0 comments on commit 8f024ba

Please sign in to comment.