Fixing up documentation, missing functions, examples and alpha masks.

This commit is contained in:
photonstorm
2014-02-21 14:50:18 +00:00
parent eb38ae35f8
commit 07af06fc4e
12 changed files with 565 additions and 115 deletions
+7 -14
View File
@@ -118,10 +118,15 @@ Phaser.Game = function (width, height, renderer, parent, state, transparent, ant
this.raf = null;
/**
* @property {Phaser.GameObjectFactory} add - Reference to the GameObject Factory.
* @property {Phaser.GameObjectFactory} add - Reference to the Phaser.GameObjectFactory.
*/
this.add = null;
/**
* @property {Phaser.GameObjectCreator} make - Reference to the GameObject Creator.
*/
this.make = null;
/**
* @property {Phaser.Cache} cache - Reference to the assets cache.
* @default
@@ -440,6 +445,7 @@ Phaser.Game.prototype = {
this.world = new Phaser.World(this);
this.add = new Phaser.GameObjectFactory(this);
this.make = new Phaser.GameObjectCreator(this);
this.cache = new Phaser.Cache(this);
this.load = new Phaser.Loader(this);
this.time = new Phaser.Time(this);
@@ -534,14 +540,6 @@ Phaser.Game.prototype = {
*/
setUpRenderer: function () {
/*
if (this.device.trident)
{
// Pixi WebGL renderer on IE11 doesn't work correctly with masks, if you need them you may want to comment this block out
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)
@@ -553,7 +551,6 @@ Phaser.Game.prototype = {
this.renderer = new PIXI.CanvasRenderer(this.width, this.height, this.canvas, this.transparent);
Phaser.Canvas.setSmoothingEnabled(this.renderer.context, this.antialias);
// this.canvas = this.renderer.view;
this.context = this.renderer.context;
}
else
@@ -566,13 +563,9 @@ Phaser.Game.prototype = {
// They requested WebGL, and their browser supports it
this.renderType = Phaser.WEBGL;
this.renderer = new PIXI.WebGLRenderer(this.width, this.height, this.canvas, this.transparent, this.antialias);
// this.canvas = this.renderer.view;
this.context = null;
}
// Phaser.Canvas.addToDOM(this.renderer.view, this.parent, true);
// Phaser.Canvas.setTouchAction(this.renderer.view);
Phaser.Canvas.addToDOM(this.canvas, this.parent, true);
Phaser.Canvas.setTouchAction(this.canvas);
+1
View File
@@ -329,6 +329,7 @@ Phaser.StateManager.prototype = {
this.states[key].game = this.game;
this.states[key].add = this.game.add;
this.states[key].make = this.game.make;
this.states[key].camera = this.game.camera;
this.states[key].cache = this.game.cache;
this.states[key].input = this.game.input;