mirror of
https://github.com/wassname/phaser.git
synced 2026-09-09 11:28:47 +08:00
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:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user