| | |
| | | $HUMBLE_API: { |
| | | file_cache: {}, |
| | | options: { |
| | | // allows altering the incoming URL before it is fetched from the network |
| | | locateAsset: null, // function(path) { return path; } |
| | | // returns a key for the specified path. return null to NOT cache the specific resource |
| | | // for scoped keys.. return { scope: 'deadbeef', path: 'path' }, otherwise just return a string |
| | | buildCacheKey: null, // function(path) { return path; } |
| | | // function returning a hash like {width: 800, height: 600, locked: true} |
| | | // locked specifies whether the game should ONLY use that width/height |
| | | playerSize: null // function() { return { width: 800, height: 600, locked: true } } |
| | | /** |
| | | * allows altering the incoming URL before it is fetched from the network |
| | | * ex. function(path) { return path; } |
| | | */ |
| | | locateAsset: null, |
| | | /** |
| | | * returns a key for the specified path. return null to NOT cache the specific resource |
| | | * for scoped keys.. return { scope: 'deadbeef', path: 'path' }, otherwise just return a string |
| | | * ex. function(path) { return path; } |
| | | */ |
| | | buildCacheKey: null, |
| | | /** |
| | | * function returning a hash like {width: 800, height: 600, locked: true} |
| | | * locked specifies whether the game should use that width/height. |
| | | * ex. function() { return { width: 800, height: 600, locked: true } } |
| | | */ |
| | | playerSize: null, |
| | | /** |
| | | * callback to handle the demo_ended API from in the game |
| | | * the callback takes no parameters. |
| | | */ |
| | | demoEndedCallback: null |
| | | }, |
| | | /** |
| | | * allows configuring the HUMBLE_API simply call this method in a preRun to initialize.. |
| | |
| | | if (w) {{{ makeSetValue('w', '0', 'ret.width', 'i32') }}}; |
| | | if (h) {{{ makeSetValue('h', '0', 'ret.height', 'i32') }}}; |
| | | return ret.locked ? 1 : 0; |
| | | }, |
| | | humble_demo_ended: ['$HUMBLE_API'], |
| | | humble_demo_ended: function() { |
| | | if (HUMBLE_API.options.demoEndedCallback) { |
| | | return HUMBLE_API.options.demoEndedCallback.call(HUMBLE_API); |
| | | } |
| | | } |
| | | }; |
| | | |