Added the new Button game object and various other input and tilemap fixes.

This commit is contained in:
Richard Davey
2013-07-12 03:28:46 +01:00
parent c81cf0c882
commit dcce99ec60
42 changed files with 1898 additions and 363 deletions
+1
View File
@@ -44,6 +44,7 @@ module Phaser {
// Zero or smaller than frame sizes?
if (width == 0 || height == 0 || width < frameWidth || height < frameHeight || total === 0)
{
throw new Error("AnimationLoader.parseSpriteSheet: width/height zero or width/height < given frameWidth/frameHeight");
return null;
}
+16
View File
@@ -312,6 +312,22 @@ module Phaser {
}
public removeCanvas(key: string) {
delete this._canvases[key];
}
public removeImage(key: string) {
delete this._images[key];
}
public removeSound(key: string) {
delete this._sounds[key];
}
public removeText(key: string) {
delete this._text[key];
}
/**
* Clean up cache memory.
*/
+4 -6
View File
@@ -71,7 +71,7 @@ module Phaser {
public hasLoaded: bool;
/**
* Loading progress (from 0 to 1)
* Loading progress (from 0 to 100)
* @type {number}
*/
public progress: number;
@@ -97,9 +97,7 @@ module Phaser {
}
public get queueSize(): number {
return this._queueSize;
}
/**
@@ -107,9 +105,9 @@ module Phaser {
* @param key {string} Unique asset key of this image file.
* @param url {string} URL of image file.
*/
public image(key: string, url: string) {
public image(key: string, url: string, overwrite: bool = false) {
if (this.checkKeyExists(key) === false)
if (overwrite == true || this.checkKeyExists(key) == false)
{
this._queueSize++;
this._fileList[key] = { type: 'image', key: key, url: url, data: null, error: false, loaded: false };
@@ -294,7 +292,7 @@ module Phaser {
}
else
{
this.progress = 1;
this.progress = 100;
this.hasLoaded = true;
this._gameCreateComplete.call(this._game);