Skip to content

Commit b2cfb29

Browse files
committed
Moved all code that modified Pixi globals into its own file, so we can call it after the Phaser overrides are in place.
1 parent 075347c commit b2cfb29

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

src/PixiDefaults.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/* global Phaser:true */
2+
/**
3+
* @author Richard Davey <rich@photonstorm.com>
4+
* @copyright 2014 Photon Storm Ltd.
5+
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
6+
*/
7+
8+
// Pixi expects these globals to exist
9+
10+
if (PIXI.blendModes === undefined)
11+
{
12+
PIXI.blendModes = Phaser.blendModes;
13+
}
14+
15+
if (PIXI.scaleModes === undefined)
16+
{
17+
PIXI.scaleModes = Phaser.scaleModes;
18+
}
19+
20+
if (PIXI.Texture.emptyTexture === undefined)
21+
{
22+
PIXI.Texture.emptyTexture = new PIXI.Texture(new PIXI.BaseTexture());
23+
}
24+
25+
if (PIXI.DisplayObject._tempMatrix === undefined)
26+
{
27+
PIXI.DisplayObject._tempMatrix = new PIXI.Matrix();
28+
}
29+
30+
if (PIXI.RenderTexture.tempMatrix === undefined)
31+
{
32+
PIXI.RenderTexture.tempMatrix = new PIXI.Matrix();
33+
}

0 commit comments

Comments
 (0)