Skip to content

Commit

Permalink
Fixed custom JSON reading
Browse files Browse the repository at this point in the history
  • Loading branch information
Eemeli Kelokorpi committed Mar 5, 2014
1 parent b307987 commit fb23d86
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/engine/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ var core = {
version: '1.1.3',
config: window.pandaConfig || {},
plugins: {},
json: {},
getJSON: function(id) {
return this.json[this.assets[id]];
},
/**
Scale factor for Retina and HiRes mode.
@property {Number} scale
Expand Down
3 changes: 2 additions & 1 deletion src/engine/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ game.Loader = game.Class.extend({
File loaded.
@method progress
**/
progress: function() {
progress: function(loader) {
if(loader.json && !loader.json.frames && !loader.json.bones) game.json[loader.url] = loader.json;
this.loaded++;
this.percent = Math.round(this.loaded / (this.assets.length + this.sounds.length) * 100);
this.onPercentChange();
Expand Down

0 comments on commit fb23d86

Please sign in to comment.