Compare commits

..

23 commits

Author SHA1 Message Date
Jeena Paradies
e1f8766a71 Added doc for BaseTexture.fromCanvas 2014-03-08 01:15:14 +01:00
Jeena Paradies
ad7ced5407 @param doc about scaleMode in Texture.fromCanvas 2014-03-08 01:09:33 +01:00
Jeena Paradies
85e6d1928e @param doc about scaleMode in Texture.fromImage 2014-03-08 01:08:20 +01:00
Chad Engler
b9363442ac bump to v1.5.1, add new builds 2014-02-13 08:09:19 -08:00
Chad Engler
60ed64d8df remove grunt-contrib-watch 2014-02-13 08:08:45 -08:00
Chad Engler
58f9cf44bb merge dev into master 2014-02-13 08:06:25 -08:00
Mat Groves
818f709764 Merge branch 'dev' of https://github.com/GoodBoyDigital/pixi.js into dev 2014-02-13 16:02:39 +00:00
Chad Engler
963ea0b4af Merge pull request #572 from anissen/fix-autoDetectRenderer-constructor
Changed parameter ordering to be consistent with WebGLRenderer and CanvasRenderer
2014-02-13 07:55:45 -08:00
Mat Groves
9706622bce updated pixi version number 2014-02-13 15:50:16 +00:00
Mat Groves
abceb5cb71 Merge branch 'dev' of https://github.com/GoodBoyDigital/pixi.js into dev 2014-02-13 15:46:42 +00:00
Mat Groves
f8a6285f7f Fixed FF tiling sprite bug
added chaining to graphics object
2014-02-13 15:44:26 +00:00
Chad Engler
86e3e0a003 Merge pull request #574 from iirelu/dev
Changed karma to have a 60,000 ms capture timeout
2014-02-12 17:30:48 -08:00
iirelu
057563cc51 Changed karma to have a 60000ms capture timeout
The previous captureTimeout was so short that on computers with even
average hardware couldn't open firefox fast enough for Karma's liking,
mostly killing the process whilst firefox was still starting up.
2014-02-13 01:12:22 +00:00
Anders Nissen
a9927ae70b Updated examples to reflect API change 2014-02-12 22:54:12 +01:00
Anders Nissen
ebd20c6de9 Changed parameter ordering to be consistent with WebGLRenderer and CanvasRenderer 2014-02-12 22:36:48 +01:00
Mat Groves
2d74436c00 Merge branch 'pr/569' into dev 2014-02-12 10:50:14 +00:00
Tim Robinson
e8d509482d Fixed updateTransform bug. 2014-02-12 18:57:04 +00:00
Mat Groves
c759801b2e Rebuild Files 2014-02-12 10:33:55 +00:00
Mat Groves
80688885b5 Merge pull request #569 from timjrobinson/updatetransform-fix
Fixed updateTransform bug.
2014-02-12 10:31:34 +00:00
Mat Groves
d558a7b222 Update README.md 2014-02-11 20:48:52 +00:00
Mat Groves
f2c6d1427b Merge branch 'dev' of https://github.com/GoodBoyDigital/pixi.js into dev 2014-02-11 11:37:36 +00:00
Mat Groves
03f1acbe3b Merge branch 'dev' of https://github.com/GoodBoyDigital/pixi.js into dev 2014-02-10 19:53:29 +00:00
Mat Groves
78d45b2399 Added cross origin and scaleMode to Sprite.fromImage 2014-02-10 19:53:23 +00:00
19 changed files with 94 additions and 105 deletions

View file

@ -80,7 +80,6 @@ module.exports = function(grunt) {
'<%= dirs.src %>/filters/DotScreenFilter.js',
'<%= dirs.src %>/filters/CrossHatchFilter.js',
'<%= dirs.src %>/filters/RGBSplitFilter.js',
'<%= dirs.src %>/filters/PaletteFilter.js',
'<%= dirs.src %>/Outro.js'
],
banner = [

View file

@ -1,7 +1,7 @@
Pixi Renderer
=============
![pixi.js logo](http://www.goodboydigital.com/pixijs/logo_small.png)
![pixi.js logo](http://www.goodboydigital.com/pixijs/logo_small.png)
[<img src="http://www.pixijs.com/wp-content/uploads/2013/05/headerPanel_projects-898x342.jpg">](http://www.pixijs.com/projects)
#### JavaScript 2D Renderer ####
@ -15,6 +15,8 @@ If youre interested in pixi.js then feel free to follow me on twitter
of course check back on [our site](<http://www.goodboydigital.com/blog/>) as
any breakthroughs will be posted up there too!
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/GoodBoyDigital/pixi.js/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
### Demos ###
- [WebGL Filters!](<http://www.goodboydigital.com/pixijs/examples/15/indexAll.html>)

View file

@ -1,10 +1,10 @@
/**
* @license
* pixi.js - v1.5.0
* pixi.js - v1.5.1
* Copyright (c) 2012-2014, Mat Groves
* http://goodboydigital.com/
*
* Compiled: 2014-02-10
* Compiled: 2014-02-13
*
* pixi.js is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license.php
@ -35,7 +35,7 @@ PIXI.WEBGL_RENDERER = 0;
PIXI.CANVAS_RENDERER = 1;
// useful for testing against if your lib is using pixi.
PIXI.VERSION = "v1.4.4";
PIXI.VERSION = "v1.5.1";
// the various blend modes supported by pixi
PIXI.blendModes = {
@ -954,8 +954,8 @@ PIXI.DisplayObject.prototype.updateTransform = function()
a01 = -this._sr * this.scale.y,
a10 = this._sr * this.scale.x,
a11 = this._cr * this.scale.y,
a02 = this.position.x + a00 * px - py * a01,
a12 = this.position.y + a11 * py - px * a10,
a02 = this.position.x - a00 * px - py * a01,
a12 = this.position.y - a11 * py - px * a10,
b00 = parentTransform.a, b01 = parentTransform.b,
b10 = parentTransform.c, b11 = parentTransform.d;
@ -1946,9 +1946,9 @@ PIXI.Sprite.fromFrame = function(frameId)
* @param imageId {String} The image url of the texture
* @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
*/
PIXI.Sprite.fromImage = function(imageId)
PIXI.Sprite.fromImage = function(imageId, crossorigin, scaleMode)
{
var texture = PIXI.Texture.fromImage(imageId);
var texture = PIXI.Texture.fromImage(imageId, crossorigin, scaleMode);
return new PIXI.Sprite(texture);
};
@ -3945,7 +3945,7 @@ PIXI.getNextPowerOfTwo = function(number)
* Adds event emitter functionality to a class
*
* @class EventTarget
*
* @example
* function MyEmitter() {
* PIXI.EventTarget.call(this); //mixes in event target stuff
* }
@ -4053,11 +4053,11 @@ PIXI.EventTarget = function () {
* @param width=800 {Number} the width of the renderers view
* @param height=600 {Number} the height of the renderers view
* @param [view] {Canvas} the canvas to use as a view, optional
* @param [antialias=false] {Boolean} sets antialias (only applicable in webGL chrome at the moment)
* @param [transparent=false] {Boolean} the transparency of the render view, default false
* @param [antialias=false] {Boolean} sets antialias (only applicable in webGL chrome at the moment)
*
*/
PIXI.autoDetectRenderer = function(width, height, view,antialias,transparent)
PIXI.autoDetectRenderer = function(width, height, view, transparent, antialias)
{
if(!width)width = 800;
if(!height)height = 600;
@ -6619,7 +6619,7 @@ PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function(tilingSprite)
// set the textures uvs temporarily
// TODO create a separate texture so that we can tile part of a texture
if(!tilingSprite._uvs)tilingSprite._uvs = new Float32Array(8);
if(!tilingSprite._uvs)tilingSprite._uvs = new PIXI.TextureUvs();
var uvs = tilingSprite._uvs;
@ -6644,7 +6644,6 @@ PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function(tilingSprite)
uvs.x3 = 0 - offsetX;
uvs.y3 = (1 *scaleY) - offsetY;
// get the tilingSprites current alpha
var alpha = tilingSprite.worldAlpha;
var tint = tilingSprite.tint;
@ -8814,6 +8813,8 @@ PIXI.Graphics.prototype.lineStyle = function(lineWidth, color, alpha)
fillColor:this.fillColor, fillAlpha:this.fillAlpha, fill:this.filling, points:[], type:PIXI.Graphics.POLY};
this.graphicsData.push(this.currentPath);
return this;
};
/**
@ -8833,6 +8834,8 @@ PIXI.Graphics.prototype.moveTo = function(x, y)
this.currentPath.points.push(x, y);
this.graphicsData.push(this.currentPath);
return this;
};
/**
@ -8847,6 +8850,8 @@ PIXI.Graphics.prototype.lineTo = function(x, y)
{
this.currentPath.points.push(x, y);
this.dirty = true;
return this;
};
/**
@ -8863,6 +8868,8 @@ PIXI.Graphics.prototype.beginFill = function(color, alpha)
this.filling = true;
this.fillColor = color || 0;
this.fillAlpha = (arguments.length < 2) ? 1 : alpha;
return this;
};
/**
@ -8875,6 +8882,8 @@ PIXI.Graphics.prototype.endFill = function()
this.filling = false;
this.fillColor = null;
this.fillAlpha = 1;
return this;
};
/**
@ -8895,6 +8904,8 @@ PIXI.Graphics.prototype.drawRect = function( x, y, width, height )
this.graphicsData.push(this.currentPath);
this.dirty = true;
return this;
};
/**
@ -8916,6 +8927,8 @@ PIXI.Graphics.prototype.drawCircle = function( x, y, radius)
this.graphicsData.push(this.currentPath);
this.dirty = true;
return this;
};
/**
@ -8938,6 +8951,8 @@ PIXI.Graphics.prototype.drawEllipse = function( x, y, width, height)
this.graphicsData.push(this.currentPath);
this.dirty = true;
return this;
};
/**
@ -8955,6 +8970,8 @@ PIXI.Graphics.prototype.clear = function()
this.graphicsData = [];
this.bounds = null; //new PIXI.Rectangle();
return this;
};
/**

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,6 @@
{
"name": "pixi.js",
"version": "1.5.0",
"version": "1.5.1",
"main": "bin/pixi.js",

View file

@ -25,8 +25,7 @@
var sprite= PIXI.Sprite.fromImage("spinObj_02.png");
//stage.addChild(sprite);
// create a renderer instance
// the 5the parameter is the anti aliasing
var renderer = PIXI.autoDetectRenderer(620, 380, null, false, true);
var renderer = PIXI.autoDetectRenderer(620, 380, null, false /* transparent */, true /* antialias */);
// set the canvas width and height to fill the screen
//renderer.view.style.width = window.innerWidth + "px";

View file

@ -32,7 +32,8 @@
// create a renderer instance
var renderer = PIXI.autoDetectRenderer(400, 300,false,true);
var renderer = PIXI.autoDetectRenderer(400, 300, null, true, true);
// add the renderer view element to the DOM
document.body.appendChild(renderer.view);

View file

@ -1,6 +1,6 @@
{
"name": "pixi.js",
"version": "1.5.0",
"version": "1.5.1",
"description": "Pixi.js is a fast lightweight 2D library that works across all devices.",
"author": "Mat Groves",

View file

@ -16,7 +16,7 @@ PIXI.WEBGL_RENDERER = 0;
PIXI.CANVAS_RENDERER = 1;
// useful for testing against if your lib is using pixi.
PIXI.VERSION = "v1.4.4";
PIXI.VERSION = "v1.5.1";
// the various blend modes supported by pixi
PIXI.blendModes = {

View file

@ -406,8 +406,8 @@ PIXI.DisplayObject.prototype.updateTransform = function()
a01 = -this._sr * this.scale.y,
a10 = this._sr * this.scale.x,
a11 = this._cr * this.scale.y,
a02 = this.position.x + a00 * px - py * a01,
a12 = this.position.y + a11 * py - px * a10,
a02 = this.position.x - a00 * px - py * a01,
a12 = this.position.y - a11 * py - px * a10,
b00 = parentTransform.a, b01 = parentTransform.b,
b10 = parentTransform.c, b11 = parentTransform.d;

View file

@ -466,8 +466,8 @@ PIXI.Sprite.fromFrame = function(frameId)
* @param imageId {String} The image url of the texture
* @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
*/
PIXI.Sprite.fromImage = function(imageId)
PIXI.Sprite.fromImage = function(imageId, crossorigin, scaleMode)
{
var texture = PIXI.Texture.fromImage(imageId);
var texture = PIXI.Texture.fromImage(imageId, crossorigin, scaleMode);
return new PIXI.Sprite(texture);
};

View file

@ -1,58 +0,0 @@
/**
* @author Mat Groves http://matgroves.com/ @Doormat23
*/
PIXI.PaletteFilter = function(paletteTexture, paletteWidth)
{
PIXI.AbstractFilter.call(this);
this.passes = [this];
// set the uniforms
this.uniforms = {
palette: { type: 'sampler2D', value: paletteTexture },
width: { type: '1f', value: paletteWidth },
widthInv: { type: '1f', value: 1 / paletteWidth }
};
this.fragmentSrc = [
'precision mediump float;',
'varying vec2 vTextureCoord;',
'varying vec4 vColor;',
'uniform sampler2D uSampler;',
'uniform sampler2D palette;',
'uniform float width;',
'uniform float widthInv;',
'void main() {',
' float index = texture2D(uSampler, vTextureCoord).r * 255.0;', //Red holds index into palette
' vec2 coord = vec2(', //convert index into coords in palette texture
' mod(index, width) * widthInv,',
' (index / width) * widthInv',
' );',
' gl_FragColor = texture2D(palette, coord);', //Read color from palette and output
'}'
];
};
PIXI.PaletteFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
PIXI.PaletteFilter.prototype.constructor = PIXI.PaletteFilter;
Object.defineProperty(PIXI.PaletteFilter.prototype, 'palette', {
get: function() {
return this.uniforms.palette.value;
},
set: function(value) {
this.uniforms.palette.value = value;
}
});
Object.defineProperty(PIXI.PaletteFilter.prototype, 'width', {
get: function() {
return this.uniforms.width.value;
},
set: function(value) {
this.uniforms.width.value = value;
this.uniforms.widthInv.value = 1 / value;
}
});

View file

@ -169,6 +169,8 @@ PIXI.Graphics.prototype.lineStyle = function(lineWidth, color, alpha)
fillColor:this.fillColor, fillAlpha:this.fillAlpha, fill:this.filling, points:[], type:PIXI.Graphics.POLY};
this.graphicsData.push(this.currentPath);
return this;
};
/**
@ -188,6 +190,8 @@ PIXI.Graphics.prototype.moveTo = function(x, y)
this.currentPath.points.push(x, y);
this.graphicsData.push(this.currentPath);
return this;
};
/**
@ -202,6 +206,8 @@ PIXI.Graphics.prototype.lineTo = function(x, y)
{
this.currentPath.points.push(x, y);
this.dirty = true;
return this;
};
/**
@ -218,6 +224,8 @@ PIXI.Graphics.prototype.beginFill = function(color, alpha)
this.filling = true;
this.fillColor = color || 0;
this.fillAlpha = (arguments.length < 2) ? 1 : alpha;
return this;
};
/**
@ -230,6 +238,8 @@ PIXI.Graphics.prototype.endFill = function()
this.filling = false;
this.fillColor = null;
this.fillAlpha = 1;
return this;
};
/**
@ -250,6 +260,8 @@ PIXI.Graphics.prototype.drawRect = function( x, y, width, height )
this.graphicsData.push(this.currentPath);
this.dirty = true;
return this;
};
/**
@ -271,6 +283,8 @@ PIXI.Graphics.prototype.drawCircle = function( x, y, radius)
this.graphicsData.push(this.currentPath);
this.dirty = true;
return this;
};
/**
@ -293,6 +307,8 @@ PIXI.Graphics.prototype.drawEllipse = function( x, y, width, height)
this.graphicsData.push(this.currentPath);
this.dirty = true;
return this;
};
/**
@ -310,6 +326,8 @@ PIXI.Graphics.prototype.clear = function()
this.graphicsData = [];
this.bounds = null; //new PIXI.Rectangle();
return this;
};
/**

View file

@ -273,7 +273,7 @@ PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function(tilingSprite)
// set the textures uvs temporarily
// TODO create a separate texture so that we can tile part of a texture
if(!tilingSprite._uvs)tilingSprite._uvs = new Float32Array(8);
if(!tilingSprite._uvs)tilingSprite._uvs = new PIXI.TextureUvs();
var uvs = tilingSprite._uvs;
@ -298,7 +298,6 @@ PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function(tilingSprite)
uvs.x3 = 0 - offsetX;
uvs.y3 = (1 *scaleY) - offsetY;
// get the tilingSprites current alpha
var alpha = tilingSprite.worldAlpha;
var tint = tilingSprite.tint;

View file

@ -167,6 +167,16 @@ PIXI.BaseTexture.fromImage = function(imageUrl, crossorigin, scaleMode)
return baseTexture;
};
/**
* Helper function that returns a base texture based on a canvas element
* If the image is not in the base texture cache it will be created and loaded
*
* @static
* @method fromCanvas
* @param canvas {Canvas} The canvas element source of the texture
* @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
* @return BaseTexture
*/
PIXI.BaseTexture.fromCanvas = function(canvas, scaleMode)
{
if(!canvas._pixiId)

View file

@ -155,6 +155,7 @@ PIXI.Texture.prototype._updateWebGLuvs = function()
* @method fromImage
* @param imageUrl {String} The image url of the texture
* @param crossorigin {Boolean} Whether requests should be treated as crossorigin
* @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
* @return Texture
*/
PIXI.Texture.fromImage = function(imageUrl, crossorigin, scaleMode)
@ -193,6 +194,7 @@ PIXI.Texture.fromFrame = function(frameId)
* @static
* @method fromCanvas
* @param canvas {Canvas} The canvas element source of the texture
* @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
* @return Texture
*/
PIXI.Texture.fromCanvas = function(canvas, scaleMode)

View file

@ -11,11 +11,11 @@
* @param width=800 {Number} the width of the renderers view
* @param height=600 {Number} the height of the renderers view
* @param [view] {Canvas} the canvas to use as a view, optional
* @param [antialias=false] {Boolean} sets antialias (only applicable in webGL chrome at the moment)
* @param [transparent=false] {Boolean} the transparency of the render view, default false
* @param [antialias=false] {Boolean} sets antialias (only applicable in webGL chrome at the moment)
*
*/
PIXI.autoDetectRenderer = function(width, height, view,antialias,transparent)
PIXI.autoDetectRenderer = function(width, height, view, transparent, antialias)
{
if(!width)width = 800;
if(!height)height = 600;

View file

@ -11,7 +11,7 @@
* Adds event emitter functionality to a class
*
* @class EventTarget
*
* @example
* function MyEmitter() {
* PIXI.EventTarget.call(this); //mixes in event target stuff
* }

View file

@ -57,8 +57,8 @@ module.exports = function(config) {
browsers : ['Firefox'],
// If browser does not capture in given timeout [ms], kill it
// CLI --capture-timeout 5000
captureTimeout : 5000,
// CLI --capture-timeout 60000
captureTimeout : 60000,
// Auto run tests on start (when browsers are captured) and exit
// CLI --single-run --no-single-run