Skip to content

Commit 9737710

Browse files
committed
Upgraded to Pixi.js 1.4.4
1 parent 68d5c73 commit 9737710

75 files changed

Lines changed: 5751 additions & 3743 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
![Phaser Logo](http://www.photonstorm.com/wp-content/uploads/2013/09/phaser_10_release.jpg)
22

3-
Phaser 1.1.5-dev
4-
================
3+
Phaser 1.2-dev
4+
==============
55

66
Phaser is a fast, free and fun open source game framework for making desktop and mobile browser HTML5 games. It uses [Pixi.js](https://github.com/GoodBoyDigital/pixi.js/) internally for fast 2D Canvas and WebGL rendering.
77

8-
Version: 1.1.5 "Saldaea" - Released: -in development-
8+
Version: 1.2 "Shienar" - Released: -in development-
99

1010
By Richard Davey, [Photon Storm](http://www.photonstorm.com)
1111

@@ -57,10 +57,11 @@ There is also an [un-official Getting Started Guide](http://www.antonoffplus.com
5757
Change Log
5858
----------
5959

60-
Version 1.1.5 - "Saldaea" - -in development-
60+
Version 1.2 - "Shienar" - -in development-
6161

6262
Significant API changes:
6363

64+
* Upgraded to Pixi.js 1.4.4
6465

6566
New features:
6667

@@ -224,10 +225,6 @@ Road Map
224225

225226
Here is what's on our road map for the coming months:
226227

227-
Version 1.2 ("Shienar")
228-
229-
* Update to Pixi 1.4 - this newly released build has lots of internal changes and new features we want to take advantage of.
230-
231228
Version 1.3 ("Tarabon")
232229

233230
* Enhance the State Management, so you can perform non-destructive State swaps and persistence.

src/pixi/InteractionData.js

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/**
2+
* @author Mat Groves http://matgroves.com/ @Doormat23
3+
*/
4+
5+
/**
6+
* Holds all information related to an Interaction event
7+
*
8+
* @class InteractionData
9+
* @constructor
10+
*/
11+
PIXI.InteractionData = function()
12+
{
13+
/**
14+
* This point stores the global coords of where the touch/mouse event happened
15+
*
16+
* @property global
17+
* @type Point
18+
*/
19+
this.global = new PIXI.Point();
20+
21+
// this is here for legacy... but will remove
22+
this.local = new PIXI.Point();
23+
24+
/**
25+
* The target Sprite that was interacted with
26+
*
27+
* @property target
28+
* @type Sprite
29+
*/
30+
this.target = null;
31+
32+
/**
33+
* When passed to an event handler, this will be the original DOM Event that was captured
34+
*
35+
* @property originalEvent
36+
* @type Event
37+
*/
38+
this.originalEvent = null;
39+
};
40+
41+
/**
42+
* This will return the local coordinates of the specified displayObject for this InteractionData
43+
*
44+
* @method getLocalPosition
45+
* @param displayObject {DisplayObject} The DisplayObject that you would like the local coords off
46+
* @return {Point} A point containing the coordinates of the InteractionData position relative to the DisplayObject
47+
*/
48+
PIXI.InteractionData.prototype.getLocalPosition = function(displayObject)
49+
{
50+
var worldTransform = displayObject.worldTransform;
51+
var global = this.global;
52+
53+
// do a cheeky transform to get the mouse coords;
54+
var a00 = worldTransform.a, a01 = worldTransform.b, a02 = worldTransform.tx,
55+
a10 = worldTransform.c, a11 = worldTransform.d, a12 = worldTransform.ty,
56+
id = 1 / (a00 * a11 + a01 * -a10);
57+
// set the mouse coords...
58+
return new PIXI.Point(a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id,
59+
a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id);
60+
};
61+
62+
// constructor
63+
PIXI.InteractionData.prototype.constructor = PIXI.InteractionData;

0 commit comments

Comments
 (0)