mirror of
https://github.com/wassname/phaser.git
synced 2026-09-11 12:31:29 +08:00
Whole codebase updated to TypeScript 0.9.1, phew!
This commit is contained in:
+1
-62
@@ -1,4 +1,4 @@
|
||||
/// <reference path="../Game.ts" />
|
||||
/// <reference path="../_definitions.ts" />
|
||||
|
||||
/**
|
||||
* Phaser - Device
|
||||
@@ -25,8 +25,6 @@ module Phaser {
|
||||
|
||||
}
|
||||
|
||||
// Android bug specific :)
|
||||
|
||||
/**
|
||||
* An optional 'fix' for the horrendous Android stock browser bug
|
||||
* https://code.google.com/p/android/issues/detail?id=39247
|
||||
@@ -549,65 +547,6 @@ module Phaser {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all informations of host device.
|
||||
* @return {string} Informations in a string.
|
||||
*/
|
||||
public getAll(): string {
|
||||
|
||||
var output: string = '';
|
||||
|
||||
output = output.concat('Device\n');
|
||||
output = output.concat('iPhone : ' + this.iPhone + '\n');
|
||||
output = output.concat('iPhone4 : ' + this.iPhone4 + '\n');
|
||||
output = output.concat('iPad : ' + this.iPad + '\n');
|
||||
|
||||
output = output.concat('\n');
|
||||
output = output.concat('Operating System\n');
|
||||
output = output.concat('iOS: ' + this.iOS + '\n');
|
||||
output = output.concat('Android: ' + this.android + '\n');
|
||||
output = output.concat('ChromeOS: ' + this.chromeOS + '\n');
|
||||
output = output.concat('Linux: ' + this.linux + '\n');
|
||||
output = output.concat('MacOS: ' + this.macOS + '\n');
|
||||
output = output.concat('Windows: ' + this.windows + '\n');
|
||||
|
||||
output = output.concat('\n');
|
||||
output = output.concat('Browser\n');
|
||||
output = output.concat('Arora: ' + this.arora + '\n');
|
||||
output = output.concat('Chrome: ' + this.chrome + '\n');
|
||||
output = output.concat('Epiphany: ' + this.epiphany + '\n');
|
||||
output = output.concat('Firefox: ' + this.firefox + '\n');
|
||||
output = output.concat('Internet Explorer: ' + this.ie + ' (' + this.ieVersion + ')\n');
|
||||
output = output.concat('Mobile Safari: ' + this.mobileSafari + '\n');
|
||||
output = output.concat('Midori: ' + this.midori + '\n');
|
||||
output = output.concat('Opera: ' + this.opera + '\n');
|
||||
output = output.concat('Safari: ' + this.safari + '\n');
|
||||
|
||||
output = output.concat('\n');
|
||||
output = output.concat('Features\n');
|
||||
output = output.concat('Canvas: ' + this.canvas + '\n');
|
||||
output = output.concat('File: ' + this.file + '\n');
|
||||
output = output.concat('FileSystem: ' + this.fileSystem + '\n');
|
||||
output = output.concat('LocalStorage: ' + this.localStorage + '\n');
|
||||
output = output.concat('WebGL: ' + this.webGL + '\n');
|
||||
output = output.concat('Worker: ' + this.worker + '\n');
|
||||
output = output.concat('Touch: ' + this.touch + '\n');
|
||||
output = output.concat('MSPointer: ' + this.mspointer + '\n');
|
||||
output = output.concat('CSS 3D: ' + this.css3D + '\n');
|
||||
|
||||
output = output.concat('\n');
|
||||
output = output.concat('Audio\n');
|
||||
output = output.concat('Audio Data: ' + this.canvas + '\n');
|
||||
output = output.concat('Web Audio: ' + this.canvas + '\n');
|
||||
output = output.concat('Can play OGG: ' + this.canvas + '\n');
|
||||
output = output.concat('Can play MP3: ' + this.canvas + '\n');
|
||||
output = output.concat('Can play M4A: ' + this.canvas + '\n');
|
||||
output = output.concat('Can play WAV: ' + this.canvas + '\n');
|
||||
|
||||
return output;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
/// <reference path="../Game.ts" />
|
||||
/// <reference path="../_definitions.ts" />
|
||||
|
||||
/**
|
||||
* Phaser - RequestAnimationFrame
|
||||
@@ -15,7 +15,7 @@ module Phaser {
|
||||
* @param {Any} callback
|
||||
* @return {RequestAnimationFrame} This object.
|
||||
*/
|
||||
constructor(game: Game, callback) {
|
||||
constructor(game: Phaser.Game, callback) {
|
||||
|
||||
this.game = game;
|
||||
this.callback = callback;
|
||||
@@ -35,7 +35,7 @@ module Phaser {
|
||||
/**
|
||||
* Local reference to Game.
|
||||
*/
|
||||
public game: Game;
|
||||
public game: Phaser.Game;
|
||||
|
||||
/**
|
||||
* The function to be called each frame. Will be called in the context of _game
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/// <reference path="../Game.ts" />
|
||||
/// <reference path="../_definitions.ts" />
|
||||
|
||||
/**
|
||||
* Phaser - StageScaleMode
|
||||
@@ -15,12 +15,12 @@ module Phaser {
|
||||
/**
|
||||
* StageScaleMode constructor
|
||||
*/
|
||||
constructor(game: Game, width: number, height: number) {
|
||||
constructor(game: Phaser.Game, width: number, height: number) {
|
||||
|
||||
this.game = game;
|
||||
|
||||
this.enterLandscape = new Phaser.Signal();
|
||||
this.enterPortrait = new Phaser.Signal();
|
||||
this.enterLandscape = new Phaser.Signal;
|
||||
this.enterPortrait = new Phaser.Signal;
|
||||
|
||||
if (window['orientation'])
|
||||
{
|
||||
@@ -38,7 +38,7 @@ module Phaser {
|
||||
}
|
||||
}
|
||||
|
||||
this.scaleFactor = new Vec2(1, 1);
|
||||
this.scaleFactor = new Phaser.Vec2(1, 1);
|
||||
this.aspectRatio = 0;
|
||||
this.minWidth = width;
|
||||
this.minHeight = height;
|
||||
@@ -53,7 +53,7 @@ module Phaser {
|
||||
/**
|
||||
* Local reference to Game.
|
||||
*/
|
||||
public game: Game;
|
||||
public game: Phaser.Game;
|
||||
|
||||
/**
|
||||
* Stage height when start the game.
|
||||
@@ -169,7 +169,7 @@ module Phaser {
|
||||
* The scale factor of the scaled game width
|
||||
* @type {Vec2}
|
||||
*/
|
||||
public scaleFactor: Vec2;
|
||||
public scaleFactor: Phaser.Vec2;
|
||||
|
||||
/**
|
||||
* Window orientation angle (90 and -90 are landscape, 0 and 80 are portrait)
|
||||
@@ -247,7 +247,7 @@ module Phaser {
|
||||
*/
|
||||
public update() {
|
||||
|
||||
if (this.game.stage.scaleMode !== StageScaleMode.NO_SCALE && (window.innerWidth !== this.width || window.innerHeight !== this.height))
|
||||
if (this.game.stage.scaleMode !== Phaser.StageScaleMode.NO_SCALE && (window.innerWidth !== this.width || window.innerHeight !== this.height))
|
||||
{
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/// <reference path="../../Game.ts" />
|
||||
/// <reference path="../../_definitions.ts" />
|
||||
|
||||
/**
|
||||
* Phaser - BootScreen
|
||||
@@ -17,7 +17,7 @@ module Phaser {
|
||||
* @param width {number} Screen canvas width.
|
||||
* @param height {number} Screen canvas height.
|
||||
*/
|
||||
constructor(game:Game) {
|
||||
constructor(game: Phaser.Game) {
|
||||
|
||||
this.game = game;
|
||||
|
||||
@@ -29,23 +29,28 @@ module Phaser {
|
||||
/**
|
||||
* Local reference to Game.
|
||||
*/
|
||||
public game: Game;
|
||||
public game: Phaser.Game;
|
||||
|
||||
/**
|
||||
* Engine logo.
|
||||
*/
|
||||
private _logo;
|
||||
|
||||
/**
|
||||
* Engine logo image data.
|
||||
*/
|
||||
private _logoData: string = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGgAAAAZCAYAAADdYmvFAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAstJREFUeNrsWlFuwjAMbavdZGcAcRm4AXzvCPuGG8BlEJxhZ+l4TJ48z3actGGthqUI1MaO/V6cmIT2/fW10eTt46NvKshtvDZlG31yfOL9a/ldU6x4IZ0GQs0gS217enMkJYr5ixXkYrFoVqtV1kDn8/n+KfXw/Hq9Nin7h8MhScB2u3Xtav2ivsNWrh7XLcWMYqA4eUZ1kj0MAifHJEeKFojWzyIH+rL/0Cwif2AX9nN1oQOgrTg8XcTFx+ScdEOJ4WBxXQ1EjRyrn0cOzzQLzFyQSQcgw/5Qkkr0JVEQpNIdhL4vm4DL5fLulNTHcy6Uxl4/6iMLiePx2KzX6/v30+n0aynUlrnSeNq2/VN9bgM4dFPdNPmsJnIg/PuQbJmLdFN3UNu0SzbyJ0GOWJVWZE/QMkY+owrqXxGEdZA37BVyX6lJTipT6J1lf7fbqc+xh8nYeIvikatP+PGW0nEJ4jOydHYOIcfKnmgWoZDQSIIeio4Sf1IthYWskCO4vqQ6lFYjl8tl9L1H67PZbMz3VO3t93uVXHofmUjReLyMwHi5eCb3ICwJj5ZU9nCg+SzUgPYyif+2epTk4pkkyDp+eXTlZu2BkUybEkklePZfK9lPuTnc07vbmt1bYulHBeNQgx18SsH4ni/cV2rSLtqNDNUH2JQ2SsXS57Y9PHlfumkwCdICt5rnkNdPjpMiIEWgRlAJSdF4SvCQMWj+VyfI0h8D/EgWSYKiJKXi8VrOhJUxaFiFCOKKUJAtR78k9eX4USLHXqLGXOIiWUT4Vj9JiP4W0io3VDz8AJXblNWQrOimLjIGy/9uLICH6mrVmFbxEFHauzmc0fGJJmPg/v+6D0oB7N2bj0FsNHtSWTQniWTR931QlHXvasDTHXLjqY0/1/8hSDxACD+lAGH8dKQbQk5N3TFtzDmLWutvV0+pL5FVoHvCNG35FGAAayS4KUoKC9QAAAAASUVORK5CYII=";
|
||||
|
||||
/**
|
||||
* Background gradient effect color 1.
|
||||
*/
|
||||
private _color1 = { r: 20, g: 20, b: 20 };
|
||||
|
||||
/**
|
||||
* Background gradient effect color 2.
|
||||
*/
|
||||
private _color2 = { r: 200, g: 200, b: 200 };
|
||||
|
||||
/**
|
||||
* Fade effect tween.
|
||||
* @type {Phaser.Tween}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/// <reference path="../../Game.ts" />
|
||||
/// <reference path="../../_definitions.ts" />
|
||||
|
||||
/**
|
||||
* Phaser - OrientationScreen
|
||||
@@ -17,14 +17,14 @@ module Phaser {
|
||||
* @param width {number} Screen canvas width.
|
||||
* @param height {number} Screen canvas height.
|
||||
*/
|
||||
constructor(game: Game) {
|
||||
constructor(game: Phaser.Game) {
|
||||
this.game = game;
|
||||
}
|
||||
|
||||
/**
|
||||
* Local reference to game.
|
||||
*/
|
||||
public game: Game;
|
||||
public game: Phaser.Game;
|
||||
|
||||
private _showOnLandscape: boolean = false;
|
||||
private _showOnPortrait: boolean = false;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/// <reference path="../../Game.ts" />
|
||||
/// <reference path="../../_definitions.ts" />
|
||||
|
||||
/**
|
||||
* Phaser - PauseScreen
|
||||
@@ -17,7 +17,7 @@ module Phaser {
|
||||
* @param width {number} Screen canvas width.
|
||||
* @param height {number} Screen canvas height.
|
||||
*/
|
||||
constructor(game: Game, width: number, height: number) {
|
||||
constructor(game: Phaser.Game, width: number, height: number) {
|
||||
|
||||
this.game = game;
|
||||
this._canvas = <HTMLCanvasElement> document.createElement('canvas');
|
||||
@@ -30,7 +30,7 @@ module Phaser {
|
||||
/**
|
||||
* Local reference to Game.
|
||||
*/
|
||||
public game: Game;
|
||||
public game: Phaser.Game;
|
||||
|
||||
/**
|
||||
* Canvas element used by engine.
|
||||
|
||||
Reference in New Issue
Block a user