mirror of
https://github.com/wassname/phaser.git
synced 2026-07-11 00:40:20 +08:00
Added the new Button game object and various other input and tilemap fixes.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user