diff --git a/LICENSE b/LICENSE
index 39cbfb0..912d9dd 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
-The MIT License
+The Pixi License
-Copyright (c) 2013-2015 Mathew Groves
+Copyright (c) 2013-2016 Mathew Groves
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/LICENSE b/LICENSE
index 39cbfb0..912d9dd 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
-The MIT License
+The Pixi License
-Copyright (c) 2013-2015 Mathew Groves
+Copyright (c) 2013-2016 Mathew Groves
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index b3e4079..5248e24 100644
--- a/README.md
+++ b/README.md
@@ -14,13 +14,13 @@
hardware acceleration without prior knowledge of WebGL. Also, it's fast. Really fast.
If you want to keep up to date with the latest pixi.js news then feel free to follow us on twitter
-([@doormat23](https://twitter.com/doormat23), and [@rolnaaba](https://twitter.com/rolnaaba))
+([@doormat23](https://twitter.com/doormat23), [@bigtimebuddy](https://twitter.com/bigtimebuddy), [@ivanpopelyshev](https://twitter.com/ivanpopelyshev))
and we will keep you posted! You can also check back on [our site](http://www.goodboydigital.com/blog)
as any breakthroughs will be posted up there too!
**Your support helps us make Pixi.js even better. Make your pledge on [Patreon](https://www.patreon.com/user?u=2384552&ty=h&u=2384552) and we'll love you forever!**
-[](http://www.pixijs.com/projects/)
+[](http://www.pixijs.com/gallery/)
### What to Use Pixi.js for and When to Use It
@@ -30,6 +30,19 @@
**Boost your development and feel free to use your imagination!**
+### Learn ###
+- Website: Find out more about Pixi on the [offical website](http://www.pixijs.com/).
+- Getting started: Check out @kittykatattack's comprehensive [tutorial](https://github.com/kittykatattack/learningPixi).
+- Examples: Get stuck right in and play around with pixi code and features right [here](http://pixijs.github.io/examples/)!
+- Docs: Get to know the Pixi API by checking out the [docs](https://pixijs.github.io/docs/).
+- Wiki: Other misc tutorials and resources are [on the Wiki](https://github.com/pixijs/pixi.js/wiki/Resources).
+
+### Community ###
+- Forums: Check out the [forum] (http://www.html5gamedevs.com/forum/15-pixijs/) and [Stackoverflow] (http://stackoverflow.com/search?q=pixi.js), both friendly places to ask your pixi questions.
+- Inspiration: Check out the [gallery](http://www.pixijs.com/gallery) to see some of the amazing things people have created!
+- Chat: You can join us on [Gitter](https://gitter.im/pixijs/pixi.js) To chat about Pixi. We also now have a Slack channel. If you would like to join it please Send me an email (mat@goodboydigital.com) and I will invite you in.
+
+
### Installation ###
Pixi.js can be installed with [Bower](https://bower.io/#getting-started), [NPM](https://docs.npmjs.com/getting-started/what-is-npm) or simply using a content delivery network (CDN) URL to embed Pixi.js directly on your HTML page.
@@ -51,6 +64,7 @@
```html
```
+
_Note: `4.0.0` can be replaced by any [released](https://github.com/pixijs/pixi.js/releases) version._
@@ -73,14 +87,6 @@
Thanks to [@photonstorm](https://twitter.com/photonstorm) for providing
those last 2 examples and allowing us to share the source code :)
-### Resources ###
-
-- Learning Pixi - a brilliant guide [here](https://github.com/kittykatattack/learningPixi)
-- API Documentation is [here](http://pixijs.github.io/docs).
-- Feature Examples are [here](https://pixijs.github.io/examples).
-- The Pixi.js Forum is [here](http://www.html5gamedevs.com/forum/15-pixijs).
-- Other misc tutorials and resources are [on the Wiki](https://github.com/pixijs/pixi.js/wiki/Resources).
-
### Contribute ###
Want to be part of the pixi.js project? Great! All are welcome! We will get there quicker
diff --git a/LICENSE b/LICENSE
index 39cbfb0..912d9dd 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
-The MIT License
+The Pixi License
-Copyright (c) 2013-2015 Mathew Groves
+Copyright (c) 2013-2016 Mathew Groves
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index b3e4079..5248e24 100644
--- a/README.md
+++ b/README.md
@@ -14,13 +14,13 @@
hardware acceleration without prior knowledge of WebGL. Also, it's fast. Really fast.
If you want to keep up to date with the latest pixi.js news then feel free to follow us on twitter
-([@doormat23](https://twitter.com/doormat23), and [@rolnaaba](https://twitter.com/rolnaaba))
+([@doormat23](https://twitter.com/doormat23), [@bigtimebuddy](https://twitter.com/bigtimebuddy), [@ivanpopelyshev](https://twitter.com/ivanpopelyshev))
and we will keep you posted! You can also check back on [our site](http://www.goodboydigital.com/blog)
as any breakthroughs will be posted up there too!
**Your support helps us make Pixi.js even better. Make your pledge on [Patreon](https://www.patreon.com/user?u=2384552&ty=h&u=2384552) and we'll love you forever!**
-[](http://www.pixijs.com/projects/)
+[](http://www.pixijs.com/gallery/)
### What to Use Pixi.js for and When to Use It
@@ -30,6 +30,19 @@
**Boost your development and feel free to use your imagination!**
+### Learn ###
+- Website: Find out more about Pixi on the [offical website](http://www.pixijs.com/).
+- Getting started: Check out @kittykatattack's comprehensive [tutorial](https://github.com/kittykatattack/learningPixi).
+- Examples: Get stuck right in and play around with pixi code and features right [here](http://pixijs.github.io/examples/)!
+- Docs: Get to know the Pixi API by checking out the [docs](https://pixijs.github.io/docs/).
+- Wiki: Other misc tutorials and resources are [on the Wiki](https://github.com/pixijs/pixi.js/wiki/Resources).
+
+### Community ###
+- Forums: Check out the [forum] (http://www.html5gamedevs.com/forum/15-pixijs/) and [Stackoverflow] (http://stackoverflow.com/search?q=pixi.js), both friendly places to ask your pixi questions.
+- Inspiration: Check out the [gallery](http://www.pixijs.com/gallery) to see some of the amazing things people have created!
+- Chat: You can join us on [Gitter](https://gitter.im/pixijs/pixi.js) To chat about Pixi. We also now have a Slack channel. If you would like to join it please Send me an email (mat@goodboydigital.com) and I will invite you in.
+
+
### Installation ###
Pixi.js can be installed with [Bower](https://bower.io/#getting-started), [NPM](https://docs.npmjs.com/getting-started/what-is-npm) or simply using a content delivery network (CDN) URL to embed Pixi.js directly on your HTML page.
@@ -51,6 +64,7 @@
```html
```
+
_Note: `4.0.0` can be replaced by any [released](https://github.com/pixijs/pixi.js/releases) version._
@@ -73,14 +87,6 @@
Thanks to [@photonstorm](https://twitter.com/photonstorm) for providing
those last 2 examples and allowing us to share the source code :)
-### Resources ###
-
-- Learning Pixi - a brilliant guide [here](https://github.com/kittykatattack/learningPixi)
-- API Documentation is [here](http://pixijs.github.io/docs).
-- Feature Examples are [here](https://pixijs.github.io/examples).
-- The Pixi.js Forum is [here](http://www.html5gamedevs.com/forum/15-pixijs).
-- Other misc tutorials and resources are [on the Wiki](https://github.com/pixijs/pixi.js/wiki/Resources).
-
### Contribute ###
Want to be part of the pixi.js project? Great! All are welcome! We will get there quicker
diff --git a/src/core/Shader.js b/src/core/Shader.js
index c390cc2..480139c 100644
--- a/src/core/Shader.js
+++ b/src/core/Shader.js
@@ -31,12 +31,13 @@
* @param gl {WebGLRenderingContext} The current WebGL rendering context
* @param vertexSrc {string|string[]} The vertex shader source as an array of strings.
* @param fragmentSrc {string|string[]} The fragment shader source as an array of strings.
+ * @param attributeLocations {Object} An attribute location map that lets you manually set the attribute locations.
*/
class Shader extends GLShader
{
- constructor(gl, vertexSrc, fragmentSrc)
+ constructor(gl, vertexSrc, fragmentSrc, attributeLocations)
{
- super(gl, checkPrecision(vertexSrc), checkPrecision(fragmentSrc));
+ super(gl, checkPrecision(vertexSrc), checkPrecision(fragmentSrc, attributeLocations));
}
}
diff --git a/LICENSE b/LICENSE
index 39cbfb0..912d9dd 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
-The MIT License
+The Pixi License
-Copyright (c) 2013-2015 Mathew Groves
+Copyright (c) 2013-2016 Mathew Groves
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index b3e4079..5248e24 100644
--- a/README.md
+++ b/README.md
@@ -14,13 +14,13 @@
hardware acceleration without prior knowledge of WebGL. Also, it's fast. Really fast.
If you want to keep up to date with the latest pixi.js news then feel free to follow us on twitter
-([@doormat23](https://twitter.com/doormat23), and [@rolnaaba](https://twitter.com/rolnaaba))
+([@doormat23](https://twitter.com/doormat23), [@bigtimebuddy](https://twitter.com/bigtimebuddy), [@ivanpopelyshev](https://twitter.com/ivanpopelyshev))
and we will keep you posted! You can also check back on [our site](http://www.goodboydigital.com/blog)
as any breakthroughs will be posted up there too!
**Your support helps us make Pixi.js even better. Make your pledge on [Patreon](https://www.patreon.com/user?u=2384552&ty=h&u=2384552) and we'll love you forever!**
-[](http://www.pixijs.com/projects/)
+[](http://www.pixijs.com/gallery/)
### What to Use Pixi.js for and When to Use It
@@ -30,6 +30,19 @@
**Boost your development and feel free to use your imagination!**
+### Learn ###
+- Website: Find out more about Pixi on the [offical website](http://www.pixijs.com/).
+- Getting started: Check out @kittykatattack's comprehensive [tutorial](https://github.com/kittykatattack/learningPixi).
+- Examples: Get stuck right in and play around with pixi code and features right [here](http://pixijs.github.io/examples/)!
+- Docs: Get to know the Pixi API by checking out the [docs](https://pixijs.github.io/docs/).
+- Wiki: Other misc tutorials and resources are [on the Wiki](https://github.com/pixijs/pixi.js/wiki/Resources).
+
+### Community ###
+- Forums: Check out the [forum] (http://www.html5gamedevs.com/forum/15-pixijs/) and [Stackoverflow] (http://stackoverflow.com/search?q=pixi.js), both friendly places to ask your pixi questions.
+- Inspiration: Check out the [gallery](http://www.pixijs.com/gallery) to see some of the amazing things people have created!
+- Chat: You can join us on [Gitter](https://gitter.im/pixijs/pixi.js) To chat about Pixi. We also now have a Slack channel. If you would like to join it please Send me an email (mat@goodboydigital.com) and I will invite you in.
+
+
### Installation ###
Pixi.js can be installed with [Bower](https://bower.io/#getting-started), [NPM](https://docs.npmjs.com/getting-started/what-is-npm) or simply using a content delivery network (CDN) URL to embed Pixi.js directly on your HTML page.
@@ -51,6 +64,7 @@
```html
```
+
_Note: `4.0.0` can be replaced by any [released](https://github.com/pixijs/pixi.js/releases) version._
@@ -73,14 +87,6 @@
Thanks to [@photonstorm](https://twitter.com/photonstorm) for providing
those last 2 examples and allowing us to share the source code :)
-### Resources ###
-
-- Learning Pixi - a brilliant guide [here](https://github.com/kittykatattack/learningPixi)
-- API Documentation is [here](http://pixijs.github.io/docs).
-- Feature Examples are [here](https://pixijs.github.io/examples).
-- The Pixi.js Forum is [here](http://www.html5gamedevs.com/forum/15-pixijs).
-- Other misc tutorials and resources are [on the Wiki](https://github.com/pixijs/pixi.js/wiki/Resources).
-
### Contribute ###
Want to be part of the pixi.js project? Great! All are welcome! We will get there quicker
diff --git a/src/core/Shader.js b/src/core/Shader.js
index c390cc2..480139c 100644
--- a/src/core/Shader.js
+++ b/src/core/Shader.js
@@ -31,12 +31,13 @@
* @param gl {WebGLRenderingContext} The current WebGL rendering context
* @param vertexSrc {string|string[]} The vertex shader source as an array of strings.
* @param fragmentSrc {string|string[]} The fragment shader source as an array of strings.
+ * @param attributeLocations {Object} An attribute location map that lets you manually set the attribute locations.
*/
class Shader extends GLShader
{
- constructor(gl, vertexSrc, fragmentSrc)
+ constructor(gl, vertexSrc, fragmentSrc, attributeLocations)
{
- super(gl, checkPrecision(vertexSrc), checkPrecision(fragmentSrc));
+ super(gl, checkPrecision(vertexSrc), checkPrecision(fragmentSrc, attributeLocations));
}
}
diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js
index f97368b..cadb190 100644
--- a/src/core/graphics/Graphics.js
+++ b/src/core/graphics/Graphics.js
@@ -725,12 +725,13 @@
{
if(!Graphics._SPRITE_TEXTURE)
{
- Graphics._SPRITE_TEXTURE = RenderTexture.create(10, 10);
-
- let currentRenderTarget = renderer._activeRenderTarget;
- renderer.bindRenderTexture(Graphics._SPRITE_TEXTURE);
- renderer.clear([1,1,1,1]);
- renderer.bindRenderTarget(currentRenderTarget);
+ let canvas = document.createElement('canvas');
+ canvas.width = 10;
+ canvas.height = 10;
+ let context = canvas.getContext('2d');
+ context.fillStyle = 'white';
+ context.fillRect(0, 0, 10, 10);
+ Graphics._SPRITE_TEXTURE = Texture.fromCanvas(canvas);
}
this._spriteRect = new Sprite(Graphics._SPRITE_TEXTURE);
diff --git a/LICENSE b/LICENSE
index 39cbfb0..912d9dd 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
-The MIT License
+The Pixi License
-Copyright (c) 2013-2015 Mathew Groves
+Copyright (c) 2013-2016 Mathew Groves
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index b3e4079..5248e24 100644
--- a/README.md
+++ b/README.md
@@ -14,13 +14,13 @@
hardware acceleration without prior knowledge of WebGL. Also, it's fast. Really fast.
If you want to keep up to date with the latest pixi.js news then feel free to follow us on twitter
-([@doormat23](https://twitter.com/doormat23), and [@rolnaaba](https://twitter.com/rolnaaba))
+([@doormat23](https://twitter.com/doormat23), [@bigtimebuddy](https://twitter.com/bigtimebuddy), [@ivanpopelyshev](https://twitter.com/ivanpopelyshev))
and we will keep you posted! You can also check back on [our site](http://www.goodboydigital.com/blog)
as any breakthroughs will be posted up there too!
**Your support helps us make Pixi.js even better. Make your pledge on [Patreon](https://www.patreon.com/user?u=2384552&ty=h&u=2384552) and we'll love you forever!**
-[](http://www.pixijs.com/projects/)
+[](http://www.pixijs.com/gallery/)
### What to Use Pixi.js for and When to Use It
@@ -30,6 +30,19 @@
**Boost your development and feel free to use your imagination!**
+### Learn ###
+- Website: Find out more about Pixi on the [offical website](http://www.pixijs.com/).
+- Getting started: Check out @kittykatattack's comprehensive [tutorial](https://github.com/kittykatattack/learningPixi).
+- Examples: Get stuck right in and play around with pixi code and features right [here](http://pixijs.github.io/examples/)!
+- Docs: Get to know the Pixi API by checking out the [docs](https://pixijs.github.io/docs/).
+- Wiki: Other misc tutorials and resources are [on the Wiki](https://github.com/pixijs/pixi.js/wiki/Resources).
+
+### Community ###
+- Forums: Check out the [forum] (http://www.html5gamedevs.com/forum/15-pixijs/) and [Stackoverflow] (http://stackoverflow.com/search?q=pixi.js), both friendly places to ask your pixi questions.
+- Inspiration: Check out the [gallery](http://www.pixijs.com/gallery) to see some of the amazing things people have created!
+- Chat: You can join us on [Gitter](https://gitter.im/pixijs/pixi.js) To chat about Pixi. We also now have a Slack channel. If you would like to join it please Send me an email (mat@goodboydigital.com) and I will invite you in.
+
+
### Installation ###
Pixi.js can be installed with [Bower](https://bower.io/#getting-started), [NPM](https://docs.npmjs.com/getting-started/what-is-npm) or simply using a content delivery network (CDN) URL to embed Pixi.js directly on your HTML page.
@@ -51,6 +64,7 @@
```html
```
+
_Note: `4.0.0` can be replaced by any [released](https://github.com/pixijs/pixi.js/releases) version._
@@ -73,14 +87,6 @@
Thanks to [@photonstorm](https://twitter.com/photonstorm) for providing
those last 2 examples and allowing us to share the source code :)
-### Resources ###
-
-- Learning Pixi - a brilliant guide [here](https://github.com/kittykatattack/learningPixi)
-- API Documentation is [here](http://pixijs.github.io/docs).
-- Feature Examples are [here](https://pixijs.github.io/examples).
-- The Pixi.js Forum is [here](http://www.html5gamedevs.com/forum/15-pixijs).
-- Other misc tutorials and resources are [on the Wiki](https://github.com/pixijs/pixi.js/wiki/Resources).
-
### Contribute ###
Want to be part of the pixi.js project? Great! All are welcome! We will get there quicker
diff --git a/src/core/Shader.js b/src/core/Shader.js
index c390cc2..480139c 100644
--- a/src/core/Shader.js
+++ b/src/core/Shader.js
@@ -31,12 +31,13 @@
* @param gl {WebGLRenderingContext} The current WebGL rendering context
* @param vertexSrc {string|string[]} The vertex shader source as an array of strings.
* @param fragmentSrc {string|string[]} The fragment shader source as an array of strings.
+ * @param attributeLocations {Object} An attribute location map that lets you manually set the attribute locations.
*/
class Shader extends GLShader
{
- constructor(gl, vertexSrc, fragmentSrc)
+ constructor(gl, vertexSrc, fragmentSrc, attributeLocations)
{
- super(gl, checkPrecision(vertexSrc), checkPrecision(fragmentSrc));
+ super(gl, checkPrecision(vertexSrc), checkPrecision(fragmentSrc, attributeLocations));
}
}
diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js
index f97368b..cadb190 100644
--- a/src/core/graphics/Graphics.js
+++ b/src/core/graphics/Graphics.js
@@ -725,12 +725,13 @@
{
if(!Graphics._SPRITE_TEXTURE)
{
- Graphics._SPRITE_TEXTURE = RenderTexture.create(10, 10);
-
- let currentRenderTarget = renderer._activeRenderTarget;
- renderer.bindRenderTexture(Graphics._SPRITE_TEXTURE);
- renderer.clear([1,1,1,1]);
- renderer.bindRenderTarget(currentRenderTarget);
+ let canvas = document.createElement('canvas');
+ canvas.width = 10;
+ canvas.height = 10;
+ let context = canvas.getContext('2d');
+ context.fillStyle = 'white';
+ context.fillRect(0, 0, 10, 10);
+ Graphics._SPRITE_TEXTURE = Texture.fromCanvas(canvas);
}
this._spriteRect = new Sprite(Graphics._SPRITE_TEXTURE);
diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js
index fe9c230..b68c351 100644
--- a/src/core/math/shapes/Rectangle.js
+++ b/src/core/math/shapes/Rectangle.js
@@ -80,6 +80,50 @@
}
/**
+ * returns the left edge of the rectangle
+ *
+ * @member {number}
+ * @memberof PIXI.Rectangle#
+ */
+ get left ()
+ {
+ return this.x;
+ }
+
+ /**
+ * returns the right edge of the rectangle
+ *
+ * @member {number}
+ * @memberof PIXI.Rectangle
+ */
+ get right()
+ {
+ return this.x + this.width;
+ }
+
+ /**
+ * returns the top edge of the rectangle
+ *
+ * @member {number}
+ * @memberof PIXI.Rectangle
+ */
+ get top ()
+ {
+ return this.y;
+ }
+
+ /**
+ * returns the bottom edge of the rectangle
+ *
+ * @member {number}
+ * @memberof PIXI.Rectangle
+ */
+ get bottom()
+ {
+ return this.y + this.height;
+ }
+
+ /**
* Checks whether the x and y coordinates given are contained within this Rectangle
*
* @param x {number} The X coordinate of the point to test
diff --git a/LICENSE b/LICENSE
index 39cbfb0..912d9dd 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
-The MIT License
+The Pixi License
-Copyright (c) 2013-2015 Mathew Groves
+Copyright (c) 2013-2016 Mathew Groves
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index b3e4079..5248e24 100644
--- a/README.md
+++ b/README.md
@@ -14,13 +14,13 @@
hardware acceleration without prior knowledge of WebGL. Also, it's fast. Really fast.
If you want to keep up to date with the latest pixi.js news then feel free to follow us on twitter
-([@doormat23](https://twitter.com/doormat23), and [@rolnaaba](https://twitter.com/rolnaaba))
+([@doormat23](https://twitter.com/doormat23), [@bigtimebuddy](https://twitter.com/bigtimebuddy), [@ivanpopelyshev](https://twitter.com/ivanpopelyshev))
and we will keep you posted! You can also check back on [our site](http://www.goodboydigital.com/blog)
as any breakthroughs will be posted up there too!
**Your support helps us make Pixi.js even better. Make your pledge on [Patreon](https://www.patreon.com/user?u=2384552&ty=h&u=2384552) and we'll love you forever!**
-[](http://www.pixijs.com/projects/)
+[](http://www.pixijs.com/gallery/)
### What to Use Pixi.js for and When to Use It
@@ -30,6 +30,19 @@
**Boost your development and feel free to use your imagination!**
+### Learn ###
+- Website: Find out more about Pixi on the [offical website](http://www.pixijs.com/).
+- Getting started: Check out @kittykatattack's comprehensive [tutorial](https://github.com/kittykatattack/learningPixi).
+- Examples: Get stuck right in and play around with pixi code and features right [here](http://pixijs.github.io/examples/)!
+- Docs: Get to know the Pixi API by checking out the [docs](https://pixijs.github.io/docs/).
+- Wiki: Other misc tutorials and resources are [on the Wiki](https://github.com/pixijs/pixi.js/wiki/Resources).
+
+### Community ###
+- Forums: Check out the [forum] (http://www.html5gamedevs.com/forum/15-pixijs/) and [Stackoverflow] (http://stackoverflow.com/search?q=pixi.js), both friendly places to ask your pixi questions.
+- Inspiration: Check out the [gallery](http://www.pixijs.com/gallery) to see some of the amazing things people have created!
+- Chat: You can join us on [Gitter](https://gitter.im/pixijs/pixi.js) To chat about Pixi. We also now have a Slack channel. If you would like to join it please Send me an email (mat@goodboydigital.com) and I will invite you in.
+
+
### Installation ###
Pixi.js can be installed with [Bower](https://bower.io/#getting-started), [NPM](https://docs.npmjs.com/getting-started/what-is-npm) or simply using a content delivery network (CDN) URL to embed Pixi.js directly on your HTML page.
@@ -51,6 +64,7 @@
```html
```
+
_Note: `4.0.0` can be replaced by any [released](https://github.com/pixijs/pixi.js/releases) version._
@@ -73,14 +87,6 @@
Thanks to [@photonstorm](https://twitter.com/photonstorm) for providing
those last 2 examples and allowing us to share the source code :)
-### Resources ###
-
-- Learning Pixi - a brilliant guide [here](https://github.com/kittykatattack/learningPixi)
-- API Documentation is [here](http://pixijs.github.io/docs).
-- Feature Examples are [here](https://pixijs.github.io/examples).
-- The Pixi.js Forum is [here](http://www.html5gamedevs.com/forum/15-pixijs).
-- Other misc tutorials and resources are [on the Wiki](https://github.com/pixijs/pixi.js/wiki/Resources).
-
### Contribute ###
Want to be part of the pixi.js project? Great! All are welcome! We will get there quicker
diff --git a/src/core/Shader.js b/src/core/Shader.js
index c390cc2..480139c 100644
--- a/src/core/Shader.js
+++ b/src/core/Shader.js
@@ -31,12 +31,13 @@
* @param gl {WebGLRenderingContext} The current WebGL rendering context
* @param vertexSrc {string|string[]} The vertex shader source as an array of strings.
* @param fragmentSrc {string|string[]} The fragment shader source as an array of strings.
+ * @param attributeLocations {Object} An attribute location map that lets you manually set the attribute locations.
*/
class Shader extends GLShader
{
- constructor(gl, vertexSrc, fragmentSrc)
+ constructor(gl, vertexSrc, fragmentSrc, attributeLocations)
{
- super(gl, checkPrecision(vertexSrc), checkPrecision(fragmentSrc));
+ super(gl, checkPrecision(vertexSrc), checkPrecision(fragmentSrc, attributeLocations));
}
}
diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js
index f97368b..cadb190 100644
--- a/src/core/graphics/Graphics.js
+++ b/src/core/graphics/Graphics.js
@@ -725,12 +725,13 @@
{
if(!Graphics._SPRITE_TEXTURE)
{
- Graphics._SPRITE_TEXTURE = RenderTexture.create(10, 10);
-
- let currentRenderTarget = renderer._activeRenderTarget;
- renderer.bindRenderTexture(Graphics._SPRITE_TEXTURE);
- renderer.clear([1,1,1,1]);
- renderer.bindRenderTarget(currentRenderTarget);
+ let canvas = document.createElement('canvas');
+ canvas.width = 10;
+ canvas.height = 10;
+ let context = canvas.getContext('2d');
+ context.fillStyle = 'white';
+ context.fillRect(0, 0, 10, 10);
+ Graphics._SPRITE_TEXTURE = Texture.fromCanvas(canvas);
}
this._spriteRect = new Sprite(Graphics._SPRITE_TEXTURE);
diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js
index fe9c230..b68c351 100644
--- a/src/core/math/shapes/Rectangle.js
+++ b/src/core/math/shapes/Rectangle.js
@@ -80,6 +80,50 @@
}
/**
+ * returns the left edge of the rectangle
+ *
+ * @member {number}
+ * @memberof PIXI.Rectangle#
+ */
+ get left ()
+ {
+ return this.x;
+ }
+
+ /**
+ * returns the right edge of the rectangle
+ *
+ * @member {number}
+ * @memberof PIXI.Rectangle
+ */
+ get right()
+ {
+ return this.x + this.width;
+ }
+
+ /**
+ * returns the top edge of the rectangle
+ *
+ * @member {number}
+ * @memberof PIXI.Rectangle
+ */
+ get top ()
+ {
+ return this.y;
+ }
+
+ /**
+ * returns the bottom edge of the rectangle
+ *
+ * @member {number}
+ * @memberof PIXI.Rectangle
+ */
+ get bottom()
+ {
+ return this.y + this.height;
+ }
+
+ /**
* Checks whether the x and y coordinates given are contained within this Rectangle
*
* @param x {number} The X coordinate of the point to test
diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js
index e151882..f1d5a99 100644
--- a/src/core/renderers/webgl/managers/FilterManager.js
+++ b/src/core/renderers/webgl/managers/FilterManager.js
@@ -89,25 +89,21 @@
sourceFrame.pad(padding);
if(filterData.stack[0].renderTarget.transform)
- {//jshint ignore:line
+ {
- // TODO we should fit the rect around the transform..
}
else
{
-
sourceFrame.fit(filterData.stack[0].destinationFrame);
}
+ // lets pplay the padding After we fit the element to the screen.
+ // this should stop the strange side effects that can occour when cropping to the edges
+ sourceFrame.pad(padding);
destinationFrame.width = sourceFrame.width;
destinationFrame.height = sourceFrame.height;
-
- // lets play the padding after we fit the element to the screen.
- // this should stop the strange side effects that can occour when cropping to the edges
-
-
let renderTarget = this.getPotRenderTarget(renderer.gl, sourceFrame.width, sourceFrame.height, resolution);
currentState.target = target;
diff --git a/LICENSE b/LICENSE
index 39cbfb0..912d9dd 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
-The MIT License
+The Pixi License
-Copyright (c) 2013-2015 Mathew Groves
+Copyright (c) 2013-2016 Mathew Groves
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index b3e4079..5248e24 100644
--- a/README.md
+++ b/README.md
@@ -14,13 +14,13 @@
hardware acceleration without prior knowledge of WebGL. Also, it's fast. Really fast.
If you want to keep up to date with the latest pixi.js news then feel free to follow us on twitter
-([@doormat23](https://twitter.com/doormat23), and [@rolnaaba](https://twitter.com/rolnaaba))
+([@doormat23](https://twitter.com/doormat23), [@bigtimebuddy](https://twitter.com/bigtimebuddy), [@ivanpopelyshev](https://twitter.com/ivanpopelyshev))
and we will keep you posted! You can also check back on [our site](http://www.goodboydigital.com/blog)
as any breakthroughs will be posted up there too!
**Your support helps us make Pixi.js even better. Make your pledge on [Patreon](https://www.patreon.com/user?u=2384552&ty=h&u=2384552) and we'll love you forever!**
-[](http://www.pixijs.com/projects/)
+[](http://www.pixijs.com/gallery/)
### What to Use Pixi.js for and When to Use It
@@ -30,6 +30,19 @@
**Boost your development and feel free to use your imagination!**
+### Learn ###
+- Website: Find out more about Pixi on the [offical website](http://www.pixijs.com/).
+- Getting started: Check out @kittykatattack's comprehensive [tutorial](https://github.com/kittykatattack/learningPixi).
+- Examples: Get stuck right in and play around with pixi code and features right [here](http://pixijs.github.io/examples/)!
+- Docs: Get to know the Pixi API by checking out the [docs](https://pixijs.github.io/docs/).
+- Wiki: Other misc tutorials and resources are [on the Wiki](https://github.com/pixijs/pixi.js/wiki/Resources).
+
+### Community ###
+- Forums: Check out the [forum] (http://www.html5gamedevs.com/forum/15-pixijs/) and [Stackoverflow] (http://stackoverflow.com/search?q=pixi.js), both friendly places to ask your pixi questions.
+- Inspiration: Check out the [gallery](http://www.pixijs.com/gallery) to see some of the amazing things people have created!
+- Chat: You can join us on [Gitter](https://gitter.im/pixijs/pixi.js) To chat about Pixi. We also now have a Slack channel. If you would like to join it please Send me an email (mat@goodboydigital.com) and I will invite you in.
+
+
### Installation ###
Pixi.js can be installed with [Bower](https://bower.io/#getting-started), [NPM](https://docs.npmjs.com/getting-started/what-is-npm) or simply using a content delivery network (CDN) URL to embed Pixi.js directly on your HTML page.
@@ -51,6 +64,7 @@
```html
```
+
_Note: `4.0.0` can be replaced by any [released](https://github.com/pixijs/pixi.js/releases) version._
@@ -73,14 +87,6 @@
Thanks to [@photonstorm](https://twitter.com/photonstorm) for providing
those last 2 examples and allowing us to share the source code :)
-### Resources ###
-
-- Learning Pixi - a brilliant guide [here](https://github.com/kittykatattack/learningPixi)
-- API Documentation is [here](http://pixijs.github.io/docs).
-- Feature Examples are [here](https://pixijs.github.io/examples).
-- The Pixi.js Forum is [here](http://www.html5gamedevs.com/forum/15-pixijs).
-- Other misc tutorials and resources are [on the Wiki](https://github.com/pixijs/pixi.js/wiki/Resources).
-
### Contribute ###
Want to be part of the pixi.js project? Great! All are welcome! We will get there quicker
diff --git a/src/core/Shader.js b/src/core/Shader.js
index c390cc2..480139c 100644
--- a/src/core/Shader.js
+++ b/src/core/Shader.js
@@ -31,12 +31,13 @@
* @param gl {WebGLRenderingContext} The current WebGL rendering context
* @param vertexSrc {string|string[]} The vertex shader source as an array of strings.
* @param fragmentSrc {string|string[]} The fragment shader source as an array of strings.
+ * @param attributeLocations {Object} An attribute location map that lets you manually set the attribute locations.
*/
class Shader extends GLShader
{
- constructor(gl, vertexSrc, fragmentSrc)
+ constructor(gl, vertexSrc, fragmentSrc, attributeLocations)
{
- super(gl, checkPrecision(vertexSrc), checkPrecision(fragmentSrc));
+ super(gl, checkPrecision(vertexSrc), checkPrecision(fragmentSrc, attributeLocations));
}
}
diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js
index f97368b..cadb190 100644
--- a/src/core/graphics/Graphics.js
+++ b/src/core/graphics/Graphics.js
@@ -725,12 +725,13 @@
{
if(!Graphics._SPRITE_TEXTURE)
{
- Graphics._SPRITE_TEXTURE = RenderTexture.create(10, 10);
-
- let currentRenderTarget = renderer._activeRenderTarget;
- renderer.bindRenderTexture(Graphics._SPRITE_TEXTURE);
- renderer.clear([1,1,1,1]);
- renderer.bindRenderTarget(currentRenderTarget);
+ let canvas = document.createElement('canvas');
+ canvas.width = 10;
+ canvas.height = 10;
+ let context = canvas.getContext('2d');
+ context.fillStyle = 'white';
+ context.fillRect(0, 0, 10, 10);
+ Graphics._SPRITE_TEXTURE = Texture.fromCanvas(canvas);
}
this._spriteRect = new Sprite(Graphics._SPRITE_TEXTURE);
diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js
index fe9c230..b68c351 100644
--- a/src/core/math/shapes/Rectangle.js
+++ b/src/core/math/shapes/Rectangle.js
@@ -80,6 +80,50 @@
}
/**
+ * returns the left edge of the rectangle
+ *
+ * @member {number}
+ * @memberof PIXI.Rectangle#
+ */
+ get left ()
+ {
+ return this.x;
+ }
+
+ /**
+ * returns the right edge of the rectangle
+ *
+ * @member {number}
+ * @memberof PIXI.Rectangle
+ */
+ get right()
+ {
+ return this.x + this.width;
+ }
+
+ /**
+ * returns the top edge of the rectangle
+ *
+ * @member {number}
+ * @memberof PIXI.Rectangle
+ */
+ get top ()
+ {
+ return this.y;
+ }
+
+ /**
+ * returns the bottom edge of the rectangle
+ *
+ * @member {number}
+ * @memberof PIXI.Rectangle
+ */
+ get bottom()
+ {
+ return this.y + this.height;
+ }
+
+ /**
* Checks whether the x and y coordinates given are contained within this Rectangle
*
* @param x {number} The X coordinate of the point to test
diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js
index e151882..f1d5a99 100644
--- a/src/core/renderers/webgl/managers/FilterManager.js
+++ b/src/core/renderers/webgl/managers/FilterManager.js
@@ -89,25 +89,21 @@
sourceFrame.pad(padding);
if(filterData.stack[0].renderTarget.transform)
- {//jshint ignore:line
+ {
- // TODO we should fit the rect around the transform..
}
else
{
-
sourceFrame.fit(filterData.stack[0].destinationFrame);
}
+ // lets pplay the padding After we fit the element to the screen.
+ // this should stop the strange side effects that can occour when cropping to the edges
+ sourceFrame.pad(padding);
destinationFrame.width = sourceFrame.width;
destinationFrame.height = sourceFrame.height;
-
- // lets play the padding after we fit the element to the screen.
- // this should stop the strange side effects that can occour when cropping to the edges
-
-
let renderTarget = this.getPotRenderTarget(renderer.gl, sourceFrame.width, sourceFrame.height, resolution);
currentState.target = target;
diff --git a/src/core/sprites/webgl/generateMultiTextureShader.js b/src/core/sprites/webgl/generateMultiTextureShader.js
index e76c321..8a6807f 100644
--- a/src/core/sprites/webgl/generateMultiTextureShader.js
+++ b/src/core/sprites/webgl/generateMultiTextureShader.js
@@ -23,7 +23,7 @@
fragmentSrc = fragmentSrc.replace(/%count%/gi, maxTextures);
fragmentSrc = fragmentSrc.replace(/%forloop%/gi, generateSampleSrc(maxTextures));
- let shader = new Shader(gl, vertexSrc, fragmentSrc);
+ let shader = new Shader(gl, vertexSrc, fragmentSrc, {aVertexPosition:3, aColor:2, aTextureCoord:1, aTextureId:0});
let sampleValues = [];
for (let i = 0; i < maxTextures; i++)