diff --git a/package.json b/package.json index d50339e98..e301619cf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Phaser", - "version": "1.1.1", + "version": "1.1.2", "description": "HTML5 game framework", "repository": { "type": "git", diff --git a/resources/Project Templates/Basic/Game.js b/resources/Project Templates/Basic/Game.js index 0339e7a8d..6190533de 100644 --- a/resources/Project Templates/Basic/Game.js +++ b/resources/Project Templates/Basic/Game.js @@ -1,7 +1,26 @@ BasicGame.Game = function (game) { - // Honestly, just about anything could go here. + // When a State is added to Phaser it automatically has the following properties set on it, even if they already exist: + + this.game; // a reference to the currently running game + this.add; // used to add sprites, text, groups, etc + this.camera; // a reference to the game camera + this.cache; // the game cache + this.input; // the global input manager (you can access this.input.keyboard, this.input.mouse, as well from it) + this.load; // for preloading assets + this.math; // lots of useful common math operations + this.sound; // the sound manager - add a sound, play one, set-up markers, etc + this.stage; // the game stage + this.time; // the clock + this.tweens; // the tween manager + this.world; // the game world + this.particles; // the particle manager + this.physics; // the physics manager + this.rnd; // the repeatable random number generator + + // You can use any of these from any function within this State. + // But do consider them as being 'reserved words', i.e. don't create a property for your own game called "world" or you'll over-write the world reference. }; diff --git a/resources/wip/sprites/orbit/1 logo.png b/resources/wip/sprites/orbit/1 logo.png new file mode 100644 index 000000000..879ba4ee3 Binary files /dev/null and b/resources/wip/sprites/orbit/1 logo.png differ diff --git a/resources/wip/sprites/orbit/2 menu.png b/resources/wip/sprites/orbit/2 menu.png new file mode 100644 index 000000000..1a44cf15c Binary files /dev/null and b/resources/wip/sprites/orbit/2 menu.png differ diff --git a/resources/wip/sprites/orbit/3 bg.png b/resources/wip/sprites/orbit/3 bg.png new file mode 100644 index 000000000..982fe1ff1 Binary files /dev/null and b/resources/wip/sprites/orbit/3 bg.png differ diff --git a/src/Phaser.js b/src/Phaser.js index 639e1637f..07b3aaeb1 100644 --- a/src/Phaser.js +++ b/src/Phaser.js @@ -10,6 +10,7 @@ var Phaser = Phaser || { VERSION: '<%= version %>', + DEV_VERSION: '1.1.2', GAMES: [], AUTO: 0, CANVAS: 1, diff --git a/src/core/Game.js b/src/core/Game.js index 61c43260f..ca1a06353 100644 --- a/src/core/Game.js +++ b/src/core/Game.js @@ -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. * diff --git a/src/gameobjects/Sprite.js b/src/gameobjects/Sprite.js index 6126606e9..252308b45 100644 --- a/src/gameobjects/Sprite.js +++ b/src/gameobjects/Sprite.js @@ -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