Updated Loader so it no longer checks if the animation data is valid, passes that control to the AnimationLoader. Also fixed camera bounds check in Sprite.

This commit is contained in:
Richard Davey
2013-05-23 15:45:04 +01:00
parent c7485301ca
commit 94add2ea6e
9 changed files with 637 additions and 266 deletions
@@ -78,6 +78,12 @@ module Phaser {
*/
public static parseJSONData(game: Game, json): FrameData {
// Malformed?
if (!json['frames'])
{
throw new Error("Phaser.AnimationLoader.parseJSONData: Invalid Texture Atlas JSON given, missing 'frames' array");
}
// Let's create some frames then
var data: FrameData = new FrameData();
@@ -98,6 +104,12 @@ module Phaser {
public static parseXMLData(game: Game, xml, format: number): FrameData {
// Malformed?
if (!xml.getElementsByTagName('TextureAtlas'))
{
throw new Error("Phaser.AnimationLoader.parseXMLData: Invalid Texture Atlas XML given, missing <TextureAtlas> tag");
}
// Let's create some frames then
var data: FrameData = new FrameData();