Merge branch 'master' into dev

This commit is contained in:
Chad Engler 2014-01-12 10:07:22 -08:00
commit 9c002db93c
6 changed files with 60 additions and 30 deletions

View file

@ -17,6 +17,8 @@ any breakthroughs will be posted up there too!
### Demos ###
- [WebGL Filters!](<http://www.goodboydigital.com/pixijs/examples/15/indexAll.html>)
- [Run pixi run](<http://www.goodboydigital.com/runpixierun/>)
- [Fight for Everyone](<http://www.theleisuresociety.co.uk/fightforeveryone>)
@ -150,3 +152,5 @@ It also copies the non-minified version to the examples.
```
This content is released under the (http://opensource.org/licenses/MIT) MIT License.
[![Analytics](https://ga-beacon.appspot.com/UA-39213431-2/pixi.js/index)](https://github.com/igrigorik/ga-beacon)

View file

@ -1,10 +1,10 @@
/**
* @license
* pixi.js - v1.4.0
* pixi.js - v1.4.2
* Copyright (c) 2012, Mat Groves
* http://goodboydigital.com/
*
* Compiled: 2014-01-08
* Compiled: 2014-01-10
*
* pixi.js is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license.php
@ -2256,6 +2256,8 @@ PIXI.Text.prototype.updateText = function()
var lineHeight = this.determineFontHeight('font: ' + this.style.font + ';') + this.style.strokeThickness;
this.canvas.height = lineHeight * lines.length;
if(navigator.isCocoonJS) this.context.clearRect(0,0,this.canvas.width,this.canvas.height);
//set canvas text styles
this.context.fillStyle = this.style.fill;
this.context.font = this.style.font;
@ -3103,6 +3105,10 @@ PIXI.InteractionManager.prototype.onTouchMove = function(event)
// update the touch position
touchData.global.x = (touchEvent.clientX - rect.left) * (this.target.width / rect.width);
touchData.global.y = (touchEvent.clientY - rect.top) * (this.target.height / rect.height);
if(navigator.isCocoonJS) {
touchData.global.x = touchEvent.clientX;
touchData.global.y = touchEvent.clientY;
}
}
var length = this.interactiveItems.length;
@ -3138,6 +3144,10 @@ PIXI.InteractionManager.prototype.onTouchStart = function(event)
this.touchs[touchEvent.identifier] = touchData;
touchData.global.x = (touchEvent.clientX - rect.left) * (this.target.width / rect.width);
touchData.global.y = (touchEvent.clientY - rect.top) * (this.target.height / rect.height);
if(navigator.isCocoonJS) {
touchData.global.x = touchEvent.clientX;
touchData.global.y = touchEvent.clientY;
}
var length = this.interactiveItems.length;
@ -3183,6 +3193,10 @@ PIXI.InteractionManager.prototype.onTouchEnd = function(event)
var up = false;
touchData.global.x = (touchEvent.clientX - rect.left) * (this.target.width / rect.width);
touchData.global.y = (touchEvent.clientY - rect.top) * (this.target.height / rect.height);
if(navigator.isCocoonJS) {
touchData.global.x = touchEvent.clientX;
touchData.global.y = touchEvent.clientY;
}
var length = this.interactiveItems.length;
for (var j = 0; j < length; j++)
@ -11087,36 +11101,48 @@ PIXI.BitmapFontLoader.prototype.onXMLLoaded = function()
{
if (this.ajaxRequest.status === 200 || window.location.protocol.indexOf('http') === -1)
{
var textureUrl = this.baseUrl + this.ajaxRequest.responseXML.getElementsByTagName('page')[0].attributes.getNamedItem('file').nodeValue;
var responseXML = this.ajaxRequest.responseXML;
if(!responseXML || /MSIE 9/i.test(navigator.userAgent) || navigator.isCocoonJS) {
if(typeof(window.DOMParser) === 'function') {
var domparser = new DOMParser();
responseXML = domparser.parseFromString(this.ajaxRequest.responseText, 'text/xml');
} else {
var div = document.createElement('div');
div.innerHTML = this.ajaxRequest.responseText;
responseXML = div;
}
}
var textureUrl = this.baseUrl + responseXML.getElementsByTagName('page')[0].getAttribute('file');
var image = new PIXI.ImageLoader(textureUrl, this.crossorigin);
this.texture = image.texture.baseTexture;
var data = {};
var info = this.ajaxRequest.responseXML.getElementsByTagName('info')[0];
var common = this.ajaxRequest.responseXML.getElementsByTagName('common')[0];
data.font = info.attributes.getNamedItem('face').nodeValue;
data.size = parseInt(info.attributes.getNamedItem('size').nodeValue, 10);
data.lineHeight = parseInt(common.attributes.getNamedItem('lineHeight').nodeValue, 10);
var info = responseXML.getElementsByTagName('info')[0];
var common = responseXML.getElementsByTagName('common')[0];
data.font = info.getAttribute('face');
data.size = parseInt(info.getAttribute('size'), 10);
data.lineHeight = parseInt(common.getAttribute('lineHeight'), 10);
data.chars = {};
//parse letters
var letters = this.ajaxRequest.responseXML.getElementsByTagName('char');
var letters = responseXML.getElementsByTagName('char');
for (var i = 0; i < letters.length; i++)
{
var charCode = parseInt(letters[i].attributes.getNamedItem('id').nodeValue, 10);
var charCode = parseInt(letters[i].getAttribute('id'), 10);
var textureRect = new PIXI.Rectangle(
parseInt(letters[i].attributes.getNamedItem('x').nodeValue, 10),
parseInt(letters[i].attributes.getNamedItem('y').nodeValue, 10),
parseInt(letters[i].attributes.getNamedItem('width').nodeValue, 10),
parseInt(letters[i].attributes.getNamedItem('height').nodeValue, 10)
parseInt(letters[i].getAttribute('x'), 10),
parseInt(letters[i].getAttribute('y'), 10),
parseInt(letters[i].getAttribute('width'), 10),
parseInt(letters[i].getAttribute('height'), 10)
);
data.chars[charCode] = {
xOffset: parseInt(letters[i].attributes.getNamedItem('xoffset').nodeValue, 10),
yOffset: parseInt(letters[i].attributes.getNamedItem('yoffset').nodeValue, 10),
xAdvance: parseInt(letters[i].attributes.getNamedItem('xadvance').nodeValue, 10),
xOffset: parseInt(letters[i].getAttribute('xoffset'), 10),
yOffset: parseInt(letters[i].getAttribute('yoffset'), 10),
xAdvance: parseInt(letters[i].getAttribute('xadvance'), 10),
kerning: {},
texture: PIXI.TextureCache[charCode] = new PIXI.Texture(this.texture, textureRect)
@ -11124,12 +11150,12 @@ PIXI.BitmapFontLoader.prototype.onXMLLoaded = function()
}
//parse kernings
var kernings = this.ajaxRequest.responseXML.getElementsByTagName('kerning');
var kernings = responseXML.getElementsByTagName('kerning');
for (i = 0; i < kernings.length; i++)
{
var first = parseInt(kernings[i].attributes.getNamedItem('first').nodeValue, 10);
var second = parseInt(kernings[i].attributes.getNamedItem('second').nodeValue, 10);
var amount = parseInt(kernings[i].attributes.getNamedItem('amount').nodeValue, 10);
var first = parseInt(kernings[i].getAttribute('first'), 10);
var second = parseInt(kernings[i].getAttribute('second'), 10);
var amount = parseInt(kernings[i].getAttribute('amount'), 10);
data.chars[second].kerning[first] = amount;

File diff suppressed because one or more lines are too long

View file

@ -1,11 +1,11 @@
{
"name": "pixi.js",
"version": "1.4.0",
"version": "1.4.1",
"main": "bin/pixi.js",
"ignore": [
"**/.*"
"**/.*",
"node_modules",
"bower_components",
"test"

View file

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

View file

@ -19,7 +19,6 @@ describe('pixi/display/Stage', function () {
expect(obj).to.respondTo('updateTransform');
expect(obj).to.respondTo('setBackgroundColor');
expect(obj).to.respondTo('getMousePosition');
// FIXME: duplicate member in DisplayObject
pixi_core_Matrix_confirmNewMat3(obj.worldTransform);
// FIXME: convert arg to bool in constructor
@ -44,6 +43,7 @@ describe('pixi/display/Stage', function () {
expect(obj).to.have.deep.property('backgroundColorSplit[2]', 0);
expect(obj).to.have.property('backgroundColorString', '#000000');
expect(obj).to.have.property('worldVisible', true);
});
});