Updated debug header and added more info to the project template.

This commit is contained in:
photonstorm
2013-11-01 04:58:08 +00:00
parent 581d637663
commit 787abc1e02
8 changed files with 71 additions and 10 deletions
+1
View File
@@ -10,6 +10,7 @@
var Phaser = Phaser || {
VERSION: '<%= version %>',
DEV_VERSION: '1.1.2',
GAMES: [],
AUTO: 0,
CANVAS: 1,
+43 -8
View File
@@ -306,14 +306,7 @@ Phaser.Game.prototype = {
this.load.onLoadComplete.add(this.loadComplete, this);
if (this.renderType == Phaser.CANVAS)
{
console.log('%cPhaser initialized. Rendering to Canvas.', 'color: #ffff33; background: #000000');
}
else
{
console.log('%cPhaser initialized. Rendering to WebGL.', 'color: #ffff33; background: #000000');
}
this.showDebugHeader();
this.isRunning = true;
this._loadComplete = false;
@@ -325,6 +318,48 @@ Phaser.Game.prototype = {
},
/**
* Displays a Phaser version debug header in the console.
*
* @method Phaser.Game#showDebugHeader
* @protected
*/
showDebugHeader: function () {
var v = Phaser.DEV_VERSION;
var r = 'Canvas';
var a = 'HTML Audio';
if (this.renderType == Phaser.WEBGL)
{
r = 'WebGL';
}
if (this.device.webAudio)
{
a = 'WebAudio';
}
if (this.device.chrome)
{
var args = [
'%c %c %c Phaser v' + v + ' - Renderer: ' + r + ' - Audio: ' + a + ' %c %c ',
'background: #00bff3',
'background: #0072bc',
'color: #ffffff; background: #003471',
'background: #0072bc',
'background: #00bff3'
];
console.log.apply(console, args);
}
else
{
console.log('Phaser v' + v + ' - Renderer: ' + r + ' - Audio: ' + a);
}
},
/**
* Checks if the device is capable of using the requested renderer and sets it up or an alternative if not.
*
+6
View File
@@ -142,6 +142,12 @@ Phaser.Sprite = function (game, x, y, key, frame) {
}
}
/**
* The rectangular area from the texture that will be rendered.
* @property {Phaser.Rectangle} textureRegion
*/
this.textureRegion = new Phaser.Rectangle(this.texture.frame.x, this.texture.frame.y, this.texture.frame.width, this.texture.frame.height);
/**
* The anchor sets the origin point of the texture.
* The default is 0,0 this means the textures origin is the top left