Skip to content

Commit 780b8a5

Browse files
committed
New filters and demos: LightBeams, Fire and Tunnel. Also Loader can now load script files.
1 parent 39025c1 commit 780b8a5

22 files changed

Lines changed: 546 additions & 13 deletions

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Version 1.1.3 - in build
4646
* New: Added a new in-built texture. Sprites now use __default if no texture was provided (a 32x32 transparent PNG) or __missing if one was given but not found (a 32x32 black box with a green cross through it)
4747
* New: Phaser.Filter. A new way to use the new WebGL shaders/filters that the new version of Pixi supports.
4848
* New: Phaser.BitmapData object. A Canvas you can freely draw to with lots of functions. Can be used as a texture for Sprites. See the new examples and docs for details.
49+
* New: Loader can now load JavaScript files. Just use game.load.script('key', 'url') - the file will be turned into a script tag in the document head on successful load.
4950
* New: RenderTexture.render now takes a Phaser.Group. Also added renderXY for when you don't want to make a new Point object.
5051
* New: Physics.overlap now supports Sprites, Groups or Emitters and can perform group vs. group (etc) overlap checks with a custom callback and process handler.
5152
* New: Added Sound.externalNode which allows you to connect a Sound to an external node input rather than the SoundManager gain node.
@@ -99,6 +100,8 @@ Version 1.1.3 - in build
99100
* Fixed: InputHandler.checkPointerOver now checks the visible status of the Sprite Group before processing.
100101
* Fixed: The Sprite hulls (used for tile collision) were not being updated in sprite->sprite separations (thanks jcs)
101102
* Fixed: Plugins that had a postUpdate but no Update weren't being marked as active (thanks crazysam)
103+
* Fixed: StateManager.onPausedCallback function is not called when the game is paused (thanks haden)
104+
* Fixed: Fix for 'jitter' in scrolling where tilemaps & sprites are one frame off (thanks jcs)
102105

103106
You can view the complete Change Log for all previous versions at https://github.com/photonstorm/phaser/changelog.md
104107

267 KB
Loading
410 KB
Loading

examples/assets/textures/metal.png

362 KB
Loading

examples/assets/textures/ooze.png

530 KB
Loading

examples/assets/textures/tron.png

572 KB
Loading
680 KB
Loading

examples/filters/fire.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ var filter;
77
function preload() {
88

99
game.load.image('phaser', 'assets/sprites/phaser2.png');
10+
game.load.script('fire', '../filters/Fire.js');
1011

1112
}
1213

examples/filters/lightbeams.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
2+
var game = new Phaser.Game(800, 600, Phaser.WEBGL, 'phaser-example', { preload: preload, create: create, update: update });
3+
4+
var background;
5+
var filter;
6+
7+
function preload() {
8+
9+
game.load.image('phaser', 'assets/sprites/phaser2.png');
10+
game.load.script('light', '../filters/LightBeam.js');
11+
12+
}
13+
14+
function create() {
15+
16+
var logo = game.add.sprite(game.world.centerX, game.world.centerY, 'phaser');
17+
logo.anchor.setTo(0.5, 0.5);
18+
19+
background = game.add.sprite(0, 0);
20+
background.width = 800;
21+
background.height = 600;
22+
23+
filter = game.add.filter('LightBeam', 800, 600);
24+
25+
// You have the following values to play with (defaults shown):
26+
filter.alpha = 0.0;
27+
// filter.red = 1.0;
28+
// filter.green = 1.0;
29+
// filter.blue = 2.0;
30+
// filter.thickness = 70.0;
31+
// filter.speed = 1.0;
32+
33+
background.filters = [filter];
34+
35+
}
36+
37+
function update() {
38+
39+
filter.update();
40+
41+
}

examples/filters/plasma.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
2+
var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update });
3+
4+
var background;
5+
var filter;
6+
7+
function preload() {
8+
9+
game.load.image('phaser', 'assets/sprites/phaser2.png');
10+
game.load.script('plasma', '../filters/Plasma.js');
11+
12+
}
13+
14+
function create() {
15+
16+
background = game.add.sprite(0, 0);
17+
background.width = 800;
18+
background.height = 600;
19+
20+
filter = game.add.filter('Plasma', 800, 600);
21+
22+
// You have the following values to play with (defaults shown below):
23+
24+
// filter.size = 0.03;
25+
// filter.redShift = 0.5;
26+
// filter.greenShift = 0.5;
27+
// filter.blueShift = 0.9;
28+
29+
background.filters = [filter];
30+
31+
var logo = game.add.sprite(game.world.centerX, game.world.centerY, 'phaser');
32+
logo.anchor.setTo(0.5, 0.5);
33+
34+
}
35+
36+
function update() {
37+
38+
filter.update();
39+
40+
// Uncomment for coolness :)
41+
// filter.blueShift -= 0.001;
42+
43+
}

0 commit comments

Comments
 (0)