Skip to content

Commit

Permalink
Convert build process to Rollup
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Karl committed Jul 26, 2017
1 parent 6609837 commit ff5f3ad
Show file tree
Hide file tree
Showing 148 changed files with 1,731 additions and 291 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.idea
.vscode
node_modules
bin
npm-debug.log
lib
*.log
docs
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License

Copyright (c) 2013-2016 Mathew Groves, Chad Engler
Copyright (c) 2013-2017 Mathew Groves, Chad Engler

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
89 changes: 17 additions & 72 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ Optional filters that work with PixiJS v4.

Filters include:

* **AsciiFilter** _pixi-filters/bin/ascii_
* **BloomFilter** _pixi-filters/bin/bloom_
* **BulgePinchFilter** _pixi-filters/bin/bulgepinch_
* **ColorReplaceFilter** _pixi-filters/bin/colorreplace_
* **ConvolutionFilter** _pixi-filters/bin/convolution_
* **CrossHatchFilter** _pixi-filters/bin/crosshatch_
* **DotFilter** _pixi-filters/bin/dot_
* **DropShadowFilter** _pixi-filters/bin/dropshadow_
* **GlowFilter** _pixi-filters/bin/glow_
* **EmbossFilter** _pixi-filters/bin/emboss_
* **PixelateFilter** _pixi-filters/bin/pixelate_
* **OutlineFilter** _pixi-filters/bin/outline_
* **RGBSplitFilter** _pixi-filters/bin/rgb_
* **ShockwaveFilter** _pixi-filters/bin/shockwave_
* **SimpleLightmapFilter** _pixi-filters/bin/simplelightmap_
* **TiltShiftFilter** _pixi-filters/bin/tiltshift_
* **TwistFilter** _pixi-filters/bin/twist_
* **AsciiFilter** _@pixi/filters-ascii_
* **BloomFilter** _@pixi/filters-bloom_
* **BulgePinchFilter** _@pixi/filters-bulge-pinch_
* **ColorReplaceFilter** _@pixi/filters-color-replace_
* **ConvolutionFilter** _@pixi/filters-convolution_
* **CrossHatchFilter** _@pixi/filters-cross-hatch_
* **DotFilter** _@pixi/filters-dot_
* **DropShadowFilter** _@pixi/filters-drop-shadow_
* **GlowFilter** _@pixi/filters-glow_
* **EmbossFilter** _@pixi/filters-emboss_
* **PixelateFilter** _@pixi/filters-pixelate_
* **OutlineFilter** _@pixi/filters-outline_
* **RGBSplitFilter** _@pixi/filters-rgb_
* **ShockwaveFilter** _@pixi/filters-shockwave_
* **SimpleLightmapFilter** _@pixi/filters-simple-lightmap_
* **TiltShiftFilter** _@pixi/filters-tilt-shift_
* **TwistFilter** _@pixi/filters-twist_

## Examples

Expand All @@ -36,61 +36,6 @@ Using NPM:
npm install pixi-filters
```

## Usage

### Browser

```html
<script src="pixi.js/dist/pixi.js"></script>
<script src="pixi-filters/bin/filters.js"></script>
```
```js
var filter = new PIXI.filters.AsciiFilter();
```

#### Individual Filter

```html
<script src="pixi.js/dist/pixi.js"></script>
<script src="pixi-filters/bin/dot.js"></script>
```
```js
var filter = new PIXI.filters.DotFilter();
```

### NodeJS

```js
// Include library by requiring pixi-filters module
var filters = require('pixi-filters');
var filter = new filters.DotFilter();

// Alternatively, using PIXI.filters global object
require('pixi-filters');
var filter = new PIXI.filters.DotFilter();
```

#### Individual Filter

```js
// Using a single filter
var AsciiFilter = require('pixi-filters/bin/ascii');
var filter = new AsciiFilter();
```

## Rebuilding

Make sure you run NPM install to get the build dependencies.

```bash
npm install
```

Run the `build` command to build all filters.

```bash
npm run build
```
## Documentation

API documention can be found [here](http://pixijs.github.io/pixi-filters/docs/).
100 changes: 49 additions & 51 deletions examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<script src="https://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.6.5/dat.gui.min.js"></script>
<script src="https://pixijs.download/dev/pixi.min.js"></script>
<script src="../bin/filters.js"></script>
<script src="../filters/all/lib/pixi-filters.umd.js"></script>
<style>

body {
Expand Down Expand Up @@ -118,6 +118,54 @@

var folder;

// Create wave displacement
resources.map.texture.baseTexture.wrapMode = PIXI.WRAP_MODES.REPEAT;
var displacementSprite = new PIXI.Sprite(resources.map.texture);
var displacementFilter = new PIXI.filters.DisplacementFilter(
displacementSprite,
stageWidth,
stageHeight
);
displacementFilter.scale.x = 50;
displacementFilter.scale.y = 50;
folder = gui.addFolder('DisplacementFilter (pixi.js)');
folder.add(displacementFilter, 'enabled');
folder.add(displacementFilter.scale, 'x', 1, 200).name('scale.x');
folder.add(displacementFilter.scale, 'y', 1, 200).name('scale.y');

// Setup gui for displacement
var blurFilter = new PIXI.filters.BlurFilter();
blurFilter.enabled = false;
folder = gui.addFolder('BlurFilter (pixi.js)');
folder.add(blurFilter, 'enabled');
folder.add(blurFilter, 'blur', 0, 100);
folder.add(blurFilter, 'quality', 1, 10);

// Setup gui for displacement
var noiseFilter = new PIXI.filters.NoiseFilter();
noiseFilter.enabled = false;
folder = gui.addFolder('NoiseFilter (pixi.js)');
folder.add(noiseFilter, 'enabled');
folder.add(noiseFilter, 'noise', 0, 1);
folder.add(noiseFilter, 'seed', 0.01, 0.99);

// Setup gui for displacement
var colorFilter = new PIXI.filters.ColorMatrixFilter();
colorFilter.enabled = false;
folder = gui.addFolder('ColorMatrixFilter (pixi.js)');
folder.add(colorFilter, 'enabled');
folder.add(colorFilter, 'reset');
folder.add(colorFilter, 'sepia');
folder.add(colorFilter, 'negative');
folder.add({kodachrome: colorFilter.kodachrome.bind(colorFilter, true)}, 'kodachrome');
folder.add({lsd: colorFilter.lsd.bind(colorFilter, true)}, 'lsd');
folder.add(colorFilter, 'polaroid');
folder.add(colorFilter, 'desaturate');
folder.add({contrast: colorFilter.contrast.bind(colorFilter, 1)}, 'contrast');
folder.add({greyscale: colorFilter.greyscale.bind(colorFilter, 1)}, 'greyscale');
folder.add({predator: colorFilter.predator.bind(colorFilter, 1)}, 'predator');
folder.add({saturate: colorFilter.saturate.bind(colorFilter, 1)}, 'saturate');

var outlineFilter = new PIXI.filters.OutlineFilter();
outlineFilter.enabled = false;
folder = gui.addFolder('OutlineFilter');
Expand Down Expand Up @@ -171,56 +219,6 @@
// Add the overlay
pond.addChild(overlay);

var folder;

// Create wave displacement
resources.map.texture.baseTexture.wrapMode = PIXI.WRAP_MODES.REPEAT;
var displacementSprite = new PIXI.Sprite(resources.map.texture);
var displacementFilter = new PIXI.filters.DisplacementFilter(
displacementSprite,
stageWidth,
stageHeight
);
displacementFilter.scale.x = 50;
displacementFilter.scale.y = 50;
folder = gui.addFolder('DisplacementFilter (pixi.js)');
folder.add(displacementFilter, 'enabled');
folder.add(displacementFilter.scale, 'x', 1, 200).name('scale.x');
folder.add(displacementFilter.scale, 'y', 1, 200).name('scale.y');

// Setup gui for displacement
var blurFilter = new PIXI.filters.BlurFilter();
blurFilter.enabled = false;
folder = gui.addFolder('BlurFilter (pixi.js)');
folder.add(blurFilter, 'enabled');
folder.add(blurFilter, 'blur', 0, 100);
folder.add(blurFilter, 'quality', 1, 10);

// Setup gui for displacement
var noiseFilter = new PIXI.filters.NoiseFilter();
noiseFilter.enabled = false;
folder = gui.addFolder('NoiseFilter (pixi.js)');
folder.add(noiseFilter, 'enabled');
folder.add(noiseFilter, 'noise', 0, 1);
folder.add(noiseFilter, 'seed', 0.01, 0.99);

// Setup gui for displacement
var colorFilter = new PIXI.filters.ColorMatrixFilter();
colorFilter.enabled = false;
folder = gui.addFolder('ColorMatrixFilter (pixi.js)');
folder.add(colorFilter, 'enabled');
folder.add(colorFilter, 'reset');
folder.add(colorFilter, 'sepia');
folder.add(colorFilter, 'negative');
folder.add({kodachrome: colorFilter.kodachrome.bind(colorFilter, true)}, 'kodachrome');
folder.add({lsd: colorFilter.lsd.bind(colorFilter, true)}, 'lsd');
folder.add(colorFilter, 'polaroid');
folder.add(colorFilter, 'desaturate');
folder.add({contrast: colorFilter.contrast.bind(colorFilter, 1)}, 'contrast');
folder.add({greyscale: colorFilter.greyscale.bind(colorFilter, 1)}, 'greyscale');
folder.add({predator: colorFilter.predator.bind(colorFilter, 1)}, 'predator');
folder.add({saturate: colorFilter.saturate.bind(colorFilter, 1)}, 'saturate');

// Create twist filter
var twistFilter = new PIXI.filters.TwistFilter();
twistFilter.enabled = false;
Expand Down
21 changes: 21 additions & 0 deletions filters/all/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License

Copyright (c) 2013-2017 Mathew Groves, Chad Engler

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.
65 changes: 65 additions & 0 deletions filters/all/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# PixiJS Filters

[![Build Status](https://travis-ci.org/pixijs/pixi-filters.svg?branch=master)](https://travis-ci.org/pixijs/pixi-filters) [![CDNJS](https://img.shields.io/cdnjs/v/pixi-filters.svg)](https://cdnjs.com/libraries/pixi-filters)

Optional filters that work with PixiJS v4.

Filters include:

* **AsciiFilter** _@pixi/filters-ascii_
* **BloomFilter** _@pixi/filters-bloom_
* **BulgePinchFilter** _@pixi/filters-bulge-pinch_
* **ColorReplaceFilter** _@pixi/filters-color-replace_
* **ConvolutionFilter** _@pixi/filters-convolution_
* **CrossHatchFilter** _@pixi/filters-cross-hatch_
* **DotFilter** _@pixi/filters-dot_
* **DropShadowFilter** _@pixi/filters-drop-shadow_
* **GlowFilter** _@pixi/filters-glow_
* **EmbossFilter** _@pixi/filters-emboss_
* **PixelateFilter** _@pixi/filters-pixelate_
* **OutlineFilter** _@pixi/filters-outline_
* **RGBSplitFilter** _@pixi/filters-rgb_
* **ShockwaveFilter** _@pixi/filters-shockwave_
* **SimpleLightmapFilter** _@pixi/filters-simple-lightmap_
* **TiltShiftFilter** _@pixi/filters-tilt-shift_
* **TwistFilter** _@pixi/filters-twist_

## Examples

Click [here](https://pixijs.github.io/pixi-filters/examples) for filter demos.

## Installation

Using NPM:

```bash
npm install pixi-filters
```

## Usage

### Browser

```html
<script src="https://pixijs.download/release/pixi.min.js"></script>
<script src="pixi-filters/lib/pixi-filters.umd.min.js"></script>
```
```js
var filter = new PIXI.filters.AsciiFilter();
```

### Rollup or Webpack

```js
// Include library by requiring pixi-filters module
import * as filters from 'pixi-filters';
const filter = new filters.DotFilter();

// Alternatively, using PIXI.filters global object
import 'pixi-filters';
const filter = new PIXI.filters.DotFilter();
```

## Documentation

API documention can be found [here](http://pixijs.github.io/pixi-filters/docs/).
54 changes: 54 additions & 0 deletions filters/all/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"name": "pixi-filters",
"version": "2.0.0",
"main": "lib/pixi-filters.min.js",
"description": "Optional display filters to work with PixiJS",
"author": "Mat Groves <[email protected]>",
"contributors": [
"Ivan Popelyshev <[email protected]>",
"Matt Karl <[email protected]>",
"Chad Engler <[email protected]>"
],
"module": "lib/pixi-filters.es.min.js",
"homepage": "http://pixijs.com/",
"bugs": "https://github.com/pixijs/pixi-filters/issues",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/pixijs/pixi-filters.git"
},
"files": [
"lib"
],
"scripts": {
"build:umd": "rollup -c -f umd && rollup -cp -f umd",
"build:es": "rollup -c && rollup -cp",
"build": "npm run build:umd && npm run build:es"
},
"peerDependencies": {
"pixi.js": "^4.0.0"
},
"dependencies": {
"@pixi/filter-ascii": "^2.0.0",
"@pixi/filter-bloom": "^2.0.0",
"@pixi/filter-bulge-pinch": "^2.0.0",
"@pixi/filter-color-replace": "^2.0.0",
"@pixi/filter-convolution": "^2.0.0",
"@pixi/filter-cross-hatch": "^2.0.0",
"@pixi/filter-dot": "^2.0.0",
"@pixi/filter-drop-shadow": "^2.0.0",
"@pixi/filter-emboss": "^2.0.0",
"@pixi/filter-glow": "^2.0.0",
"@pixi/filter-outline": "^2.0.0",
"@pixi/filter-pixelate": "^2.0.0",
"@pixi/filter-rgb-split": "^2.0.0",
"@pixi/filter-shockwave": "^2.0.0",
"@pixi/filter-simple-lightmap": "^2.0.0",
"@pixi/filter-tilt-shift": "^2.0.0",
"@pixi/filter-twist": "^2.0.0"
},
"devDependencies": {
"rollup": "^0.45.2",
"@tools/build": "^2.0.0"
}
}
2 changes: 2 additions & 0 deletions filters/all/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import build from '@tools/build';
export default build;
Loading

0 comments on commit ff5f3ad

Please sign in to comment.