mirror of
https://github.com/wassname/phaser.git
synced 2026-08-08 11:23:41 +08:00
Group.alpha exposed and instance returns added to Loader functions.
This commit is contained in:
@@ -117,6 +117,9 @@ Version 1.0.7 (in progress in the dev branch)
|
||||
* You can now pass a PIXI.Texture to Sprite (you also need to pass a Phaser.Frame as the frame parameter) but this is useful for Sprites sharing joint canvases.
|
||||
* Fixed Issue #101 (Mouse Button 0 is not recognised, thanks rezoner)
|
||||
* Added Sprite.destroy back in again and made it a lot more robust at cleaning up child objects.
|
||||
* Added 'return this' to all the core Loader functions so you can chain load calls if you so wish.
|
||||
* Group.alpha is now exposed publically and changes the Group container object (not the children directly, who can still have their own alpha values)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -25,7 +25,12 @@
|
||||
|
||||
function update() {
|
||||
|
||||
sprite.rotation += 0.01;
|
||||
sprite.angle += 1;
|
||||
|
||||
// Note: Due to a bug in Chrome the following doesn't work atm:
|
||||
// sprite.angle++;
|
||||
// See: https://code.google.com/p/chromium/issues/detail?id=306851
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1219,3 +1219,19 @@ Object.defineProperty(Phaser.Group.prototype, "visible", {
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
* @name Phaser.Group#alpha
|
||||
* @property {number} alpha - The alpha value of the Group container.
|
||||
*/
|
||||
Object.defineProperty(Phaser.Group.prototype, "alpha", {
|
||||
|
||||
get: function () {
|
||||
return this._container.alpha;
|
||||
},
|
||||
|
||||
set: function (value) {
|
||||
this._container.alpha = value;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
+21
-4
@@ -251,6 +251,8 @@ Phaser.Loader.prototype = {
|
||||
this.addToFileList('image', key, url);
|
||||
}
|
||||
|
||||
return this;
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -270,6 +272,8 @@ Phaser.Loader.prototype = {
|
||||
this.addToFileList('text', key, url);
|
||||
}
|
||||
|
||||
return this;
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -291,6 +295,8 @@ Phaser.Loader.prototype = {
|
||||
this.addToFileList('spritesheet', key, url, { frameWidth: frameWidth, frameHeight: frameHeight, frameMax: frameMax });
|
||||
}
|
||||
|
||||
return this;
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -312,6 +318,8 @@ Phaser.Loader.prototype = {
|
||||
this.addToFileList('tileset', key, url, { tileWidth: tileWidth, tileHeight: tileHeight, tileMax: tileMax });
|
||||
}
|
||||
|
||||
return this;
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -331,6 +339,8 @@ Phaser.Loader.prototype = {
|
||||
this.addToFileList('audio', key, urls, { buffer: null, autoDecode: autoDecode });
|
||||
}
|
||||
|
||||
return this;
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -352,7 +362,8 @@ Phaser.Loader.prototype = {
|
||||
if (mapDataURL == null && mapData == null)
|
||||
{
|
||||
console.warn('Phaser.Loader.tilemap - Both mapDataURL and mapData are null. One must be set.');
|
||||
return;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
if (this.checkKeyExists(key) === false)
|
||||
@@ -385,6 +396,8 @@ Phaser.Loader.prototype = {
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -445,6 +458,8 @@ Phaser.Loader.prototype = {
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -457,7 +472,7 @@ Phaser.Loader.prototype = {
|
||||
*/
|
||||
atlasJSONArray: function (key, textureURL, atlasURL, atlasData) {
|
||||
|
||||
this.atlas(key, textureURL, atlasURL, atlasData, Phaser.Loader.TEXTURE_ATLAS_JSON_ARRAY);
|
||||
return this.atlas(key, textureURL, atlasURL, atlasData, Phaser.Loader.TEXTURE_ATLAS_JSON_ARRAY);
|
||||
|
||||
},
|
||||
|
||||
@@ -471,7 +486,7 @@ Phaser.Loader.prototype = {
|
||||
*/
|
||||
atlasJSONHash: function (key, textureURL, atlasURL, atlasData) {
|
||||
|
||||
this.atlas(key, textureURL, atlasURL, atlasData, Phaser.Loader.TEXTURE_ATLAS_JSON_HASH);
|
||||
return this.atlas(key, textureURL, atlasURL, atlasData, Phaser.Loader.TEXTURE_ATLAS_JSON_HASH);
|
||||
|
||||
},
|
||||
|
||||
@@ -485,7 +500,7 @@ Phaser.Loader.prototype = {
|
||||
*/
|
||||
atlasXML: function (key, textureURL, atlasURL, atlasData) {
|
||||
|
||||
this.atlas(key, textureURL, atlasURL, atlasData, Phaser.Loader.TEXTURE_ATLAS_XML_STARLING);
|
||||
return this.atlas(key, textureURL, atlasURL, atlasData, Phaser.Loader.TEXTURE_ATLAS_XML_STARLING);
|
||||
|
||||
},
|
||||
|
||||
@@ -568,6 +583,8 @@ Phaser.Loader.prototype = {
|
||||
|
||||
}
|
||||
|
||||
return this;
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user