Skip to content

Commit 42c0bed

Browse files
committed
Fixed World.scale and Group.scale.
1 parent 3bfea21 commit 42c0bed

11 files changed

Lines changed: 16 additions & 55 deletions

File tree

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ Updates:
5454

5555
Bug Fixes:
5656

57-
* TBC
57+
* Cache.getImageKeys returned __missing in the array, now excluded.
58+
* Fixed Group.scale so you can now scale a Group directly.
59+
* Removed World.scale as it was preventing Group.scale from working - you can still scale the world, but you'll need to factor in Input changes yourself.
5860

5961

6062
You can view the Change Log for all previous versions at https://github.com/photonstorm/phaser/changelog.md

examples/groups/bring a child to top.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@ var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload:
22

33
function preload() {
44

5-
// Enable scaling
6-
game.stage.scaleMode = Phaser.StageScaleMode.SHOW_ALL;
7-
game.stage.scale.maxWidth = 1024;
8-
game.stage.scale.maxHeight = 672;
9-
game.stage.scale.refresh();
10-
115
game.load.image('atari1', 'assets/sprites/atari130xe.png');
126
game.load.image('atari2', 'assets/sprites/atari800xl.png');
137
game.load.image('atari4', 'assets/sprites/atari800.png');

examples/groups/bring a group to top.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ function create() {
3131
// Now let's create some random sprites and enable them all for drag and 'bring to top'
3232
for (var i = 0; i < 10; i++)
3333
{
34-
3534
var tempSprite = game.add.sprite(game.stage.randomX, game.stage.randomY, 'atari1');
3635

3736
tempSprite.name = 'atari' + i;

src/PixiPatch.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
7979
displayObject.texture.frame.y,
8080
displayObject.texture.frame.width,
8181
displayObject.texture.frame.height,
82-
(displayObject.anchor.x) * -displayObject.texture.frame.width,
83-
(displayObject.anchor.y) * -displayObject.texture.frame.height,
82+
Math.floor((displayObject.anchor.x) * -displayObject.texture.frame.width),
83+
Math.floor((displayObject.anchor.y) * -displayObject.texture.frame.height),
8484
displayObject.texture.frame.width,
8585
displayObject.texture.frame.height);
8686
}

src/core/Group.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,13 @@ Phaser.Group = function (game, parent, name, useStage) {
7777
*/
7878
this.exists = true;
7979

80+
// Replaces the PIXI.Point with a slightly more flexible one.
81+
this._container.scale = new Phaser.Point(1, 1);
82+
8083
/**
81-
* @property {Phaser.Point} scale - Replaces the PIXI.Point with a slightly more flexible one.
84+
* @property {Phaser.Point} scale - The scane of the Group container.
8285
*/
83-
this.scale = new Phaser.Point(1, 1);
86+
this.scale = this._container.scale;
8487

8588
/**
8689
* The cursor is a simple way to iterate through the objects in a Group using the Group.next and Group.previous functions.

src/core/World.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,14 @@
1212
* the world at world-based coordinates. By default a world is created the same size as your Stage.
1313
*
1414
* @class Phaser.World
15+
* @extends Phaser.Group
1516
* @constructor
1617
* @param {Phaser.Game} game - Reference to the current game instance.
1718
*/
1819
Phaser.World = function (game) {
1920

2021
Phaser.Group.call(this, game, null, '__world', false);
2122

22-
/**
23-
* @property {Phaser.Point} scale - Replaces the PIXI.Point with a slightly more flexible one.
24-
*/
25-
this.scale = new Phaser.Point(1, 1);
26-
2723
/**
2824
* The World has no fixed size, but it does have a bounds outside of which objects are no longer considered as being "in world" and you should use this to clean-up the display list and purge dead objects.
2925
* By default we set the Bounds to be from 0,0 to Game.width,Game.height. I.e. it will match the size given to the game constructor with 0,0 representing the top-left of the display.

src/gameobjects/Sprite.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,8 +1101,6 @@ Object.defineProperty(Phaser.Sprite.prototype, "inputEnabled", {
11011101

11021102
set: function (value) {
11031103

1104-
console.log('inputEnabled', value, this.input);
1105-
11061104
if (value)
11071105
{
11081106
if (this.input.enabled === false)

src/input/InputHandler.js

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -28,36 +28,6 @@ Phaser.InputHandler = function (sprite) {
2828
*/
2929
this.enabled = false;
3030

31-
/**
32-
* @property {Description} parent - Description.
33-
* @default
34-
*/
35-
// this.parent = null;
36-
37-
/**
38-
* @property {Description} next - Linked List
39-
* @default
40-
*/
41-
// this.next = null;
42-
43-
/**
44-
* @property {Description} prev - Description.
45-
* @default
46-
*/
47-
// this.prev = null;
48-
49-
/**
50-
* @property {Description} last - Description.
51-
* @default
52-
*/
53-
// this.last = this;
54-
55-
/**
56-
* @property {Description} first - Description.
57-
* @default
58-
*/
59-
// this.first = this;
60-
6131
/**
6232
* @property {number} priorityID - The PriorityID controls which Sprite receives an Input event first if they should overlap.
6333
* @default
@@ -199,8 +169,6 @@ Phaser.InputHandler.prototype = {
199169
*/
200170
start: function (priority, useHandCursor) {
201171

202-
console.log('InputHandler start');
203-
204172
priority = priority || 0;
205173
if (typeof useHandCursor == 'undefined') { useHandCursor = false; }
206174

src/loader/Cache.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ Phaser.Cache.prototype = {
745745

746746
for (var item in array)
747747
{
748-
if (item !== '__default')
748+
if (item !== '__default' && item !== '__missing')
749749
{
750750
output.push(item);
751751
}

src/net/Net.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ Phaser.Net.prototype = {
128128
var output = {};
129129
var keyValues = location.search.substring(1).split('&');
130130

131-
for (var i in keyValues) {
132-
131+
for (var i in keyValues)
132+
{
133133
var key = keyValues[i].split('=');
134134

135135
if (key.length > 1)

0 commit comments

Comments
 (0)