Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IE9 support #18

Merged
merged 4 commits into from
Sep 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- "4"
- "6"

install:
- npm install xvfb-maybe
Expand Down
12 changes: 11 additions & 1 deletion src/animate/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* @param {Object} [options.stage.assets] Assets used to preload
* @param {PIXI.Container} options.parent The Container to auto-add the stage to.
* @param {String} [options.basePath] Base root directory
* @return {PIXI.loaders.Loader} instance of PIXI resource loader
*/
/**
* Load the stage class and preload any assets
Expand All @@ -25,6 +26,7 @@
* @param {Function} StageRef Reference to the stage class.
* @param {Object} [StageRef.assets] Assets used to preload.
* @param {Function} complete The callback function when complete.
* @return {PIXI.loaders.Loader} instance of PIXI resource loader
*/
/**
* Load the stage class and preload any assets
Expand All @@ -42,6 +44,7 @@
* @param {Function} StageRef Reference to the stage class.
* @param {Object} [StageRef.assets] Assets used to preload.
* @param {PIXI.Container} parent The Container to auto-add the stage to.
* @return {PIXI.loaders.Loader} instance of PIXI resource loader
*/
const load = function(options, parent, complete, basePath) {

Expand Down Expand Up @@ -73,6 +76,11 @@ const load = function(options, parent, complete, basePath) {
complete: null
}, options || {});

const Resource = PIXI.loaders.Resource;
Resource.setExtensionLoadType('wav', Resource.LOAD_TYPE.AUDIO);
Resource.setExtensionLoadType('mp3', Resource.LOAD_TYPE.AUDIO);
Resource.setExtensionLoadType('ogg', Resource.LOAD_TYPE.AUDIO);

const loader = new PIXI.loaders.Loader();

function done() {
Expand All @@ -81,7 +89,7 @@ const load = function(options, parent, complete, basePath) {
options.parent.addChild(instance);
}
if (options.complete) {
options.complete(instance);
options.complete(instance, loader);
}
}

Expand All @@ -101,6 +109,8 @@ const load = function(options, parent, complete, basePath) {
// tiny case where there's only text and no shapes/animations
done();
}

return loader;
};

export default load;
2 changes: 1 addition & 1 deletion tasks/common/bundler.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = function(gulp, options, plugins, debug) {

let stream = bundler
.transform(plugins.babelify.configure({
presets: ['es2015'],
presets: [ ['es2015', {loose: true}] ],
sourceMaps: true
}))
.bundle()
Expand Down