Skip to content

Commit 7072923

Browse files
committed
Added the Texture Manager into the core systems list.
1 parent 3ac8c4f commit 7072923

4 files changed

Lines changed: 17 additions & 3 deletions

File tree

build/config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@
102102
<script src="$path/src/textures/Texture.js"></script>
103103
<script src="$path/src/textures/TextureSource.js"></script>
104104
<script src="$path/src/textures/Frame.js"></script>
105-
<script src="$path/src/textures/parsers/Image.js"></script>
106105
<script src="$path/src/textures/parsers/Canvas.js"></script>
106+
<script src="$path/src/textures/parsers/Image.js"></script>
107107
<script src="$path/src/textures/parsers/JSONArray.js"></script>
108108
<script src="$path/src/textures/parsers/JSONHash.js"></script>
109109
<script src="$path/src/textures/parsers/SpriteSheet.js"></script>

src/core/Game.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,11 @@ Phaser.Game = function (width, height, renderer, parent, state, transparent, ant
221221
*/
222222
this.make = null;
223223

224+
/**
225+
* @property {Phaser.TextureManager} textures - Reference to the Phaser Texture Manager.
226+
*/
227+
this.textures = null;
228+
224229
/**
225230
* @property {Phaser.Cache} cache - Reference to the assets cache.
226231
*/
@@ -603,7 +608,7 @@ Phaser.Game.prototype = {
603608

604609
this.isBooted = true;
605610

606-
PIXI.game = this;
611+
// PIXI.game = this;
607612

608613
this.math = Phaser.Math;
609614

@@ -612,6 +617,8 @@ Phaser.Game.prototype = {
612617

613618
this.setUpRenderer();
614619

620+
this.textures = new Phaser.TextureManager(this);
621+
615622
this.world = new Phaser.World(this);
616623

617624
this.add = new Phaser.GameObject.Factory(this);

src/core/State.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,15 @@ Phaser.State = function () {
2424
this.key = '';
2525

2626
/**
27-
* @property {Phaser.GameObjectFactory} add - A reference to the GameObjectFactory which can be used to add new objects to the World.
27+
* @property {Phaser.GameObject.Factory} add - A reference to the GameObjectFactory which can be used to add new objects to the World.
2828
*/
2929
this.add = null;
3030

31+
/**
32+
* @property {Phaser.TextureManager} textures - TODO
33+
*/
34+
this.textures = null;
35+
3136
/**
3237
* @property {Phaser.GameObjectCreator} make - A reference to the GameObjectCreator which can be used to make new objects.
3338
*/

src/core/StateManager.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@ Phaser.StateManager.prototype = {
470470
this.states[key].scale = this.game.scale;
471471
this.states[key].state = this;
472472
this.states[key].stage = this.game.stage;
473+
this.states[key].textures = this.game.textures;
473474
this.states[key].time = this.game.time;
474475
this.states[key].tweens = this.game.tweens;
475476
this.states[key].world = this.game.world;
@@ -503,6 +504,7 @@ Phaser.StateManager.prototype = {
503504
this.states[key].scale = null;
504505
this.states[key].state = null;
505506
this.states[key].stage = null;
507+
this.states[key].textures = null;
506508
this.states[key].time = null;
507509
this.states[key].tweens = null;
508510
this.states[key].world = null;

0 commit comments

Comments
 (0)