We now force IE11 into Canvas mode to avoid a Pixi bug with pre-multiplied alpha. Will remove once that is fixed, sorry, but it's better than no game at all, right? :(

Loader.setPreloadSprite() will now set sprite.visible = true once the crop has been applied. Should help avoid issues (#430) on super-slow connections.
This commit is contained in:
photonstorm 2014-02-21 17:29:51 +00:00
parent 5a00a0ad97
commit fb5920feec
3 changed files with 13 additions and 4 deletions

View file

@ -138,6 +138,8 @@ Updates:
* BitmapData.alphaMask will draw the given image onto a BitmapData using an image as an alpha mask.
* The new GameObjectCreator (which you access via game.make or State.make) lets you easily create an object but NOT add it to the display list.
* TilemapParser will now throw a warning if the tileset image isn't the right size for the tile dimensions.
* We now force IE11 into Canvas mode to avoid a Pixi bug with pre-multiplied alpha. Will remove once that is fixed, sorry, but it's better than no game at all, right? :(
* Loader.setPreloadSprite() will now set sprite.visible = true once the crop has been applied. Should help avoid issues (#430) on super-slow connections.
Bug Fixes:

View file

@ -540,6 +540,13 @@ Phaser.Game.prototype = {
*/
setUpRenderer: function () {
if (this.device.trident)
{
// Pixi WebGL renderer on IE11 doesn't work correctly at the moment, the pre-multiplied alpha gets all washed out.
// So we're forcing canvas for now until this is fixed, sorry. It's got to be better than no game appearing at all, right?
this.renderType = Phaser.CANVAS;
}
if (this.renderType === Phaser.HEADLESS || this.renderType === Phaser.CANVAS || (this.renderType === Phaser.AUTO && this.device.webGL === false))
{
if (this.device.canvas)

View file

@ -144,10 +144,10 @@ Phaser.Loader.prototype = {
/**
* You can set a Sprite to be a "preload" sprite by passing it to this method.
* A "preload" sprite will have its width or height crop adjusted based on the percentage of the loader in real-time.
* This allows you to easily make loading bars for games.
* This allows you to easily make loading bars for games. Note that Sprite.visible = true will be set when calling this.
*
* @method Phaser.Loader#setPreloadSprite
* @param {Phaser.Sprite} sprite - The sprite that will be cropped during the load.
* @param {Phaser.Sprite|Phaser.Image} sprite - The sprite that will be cropped during the load.
* @param {number} [direction=0] - A value of zero means the sprite width will be cropped, a value of 1 means its height will be cropped.
*/
setPreloadSprite: function (sprite, direction) {
@ -169,6 +169,8 @@ Phaser.Loader.prototype = {
sprite.crop(this.preloadSprite.crop);
sprite.visible = true;
},
/**
@ -1305,8 +1307,6 @@ Phaser.Loader.prototype = {
{
this.preloadSprite.crop.height = Math.floor((this.preloadSprite.height / 100) * this.progress);
}
// this.preloadSprite.sprite.crop = this.preloadSprite.crop;
}
this.onFileComplete.dispatch(this.progress, this._fileList[previousIndex].key, success, this.totalLoadedFiles(), this._fileList.length);