diff --git a/lib/quintus.js b/lib/quintus.js index fb826523..cdbd9257 100644 --- a/lib/quintus.js +++ b/lib/quintus.js @@ -1148,13 +1148,20 @@ var Quintus = exportTarget[key] = function(opts) { @for Quintus @method Q.component @param {String} name - component name - @param {Object} metehods - hash of methods for the component + @param {Object} [methods] - hash of methods for the component + @param {Component || string} [base] - base Component to extend */ - Q.component = function(name,methods) { + Q.component = function(name,methods,base) { if(!methods) { return Q.components[name]; } methods.name = name; methods.componentName = "." + name; - return (Q.components[name] = Q.Component.extend(name + "Component",methods)); + var Comp; + if(base) { + Comp = Q._isString(base) ? Q.components[base] : base; + } else { + Comp = Q.Component; + } + return (Q.components[name] = Comp.extend(name + "Component",methods)); }; @@ -1745,11 +1752,13 @@ var Quintus = exportTarget[key] = function(opts) { fileExt = fileParts[fileParts.length-1].toLowerCase(); if(document.location.origin === "file://" || document.location.origin === "null") { - if(!Q.fileURLAlert) { - Q.fileURLAlert = true; - alert("Quintus Error: Loading assets is not supported from file:// urls - please run from a local web-server and try again"); + if (!(window && window.process && window.process.type)) { // otherwise we're probably using electron so it's OK + if(!Q.fileURLAlert) { + Q.fileURLAlert = true; + alert("Quintus Error: Loading assets is not supported from file:// urls - please run from a local web-server and try again"); + } + return errorCallback(); } - return errorCallback(); } request.onreadystatechange = function() { diff --git a/lib/quintus_audio.js b/lib/quintus_audio.js index 817a9a0a..f1c2ac6d 100644 --- a/lib/quintus_audio.js +++ b/lib/quintus_audio.js @@ -69,6 +69,8 @@ Quintus.Audio = function(Q) { source.connect(Q.audioContext.destination); if(options && options['loop']) { source.loop = true; + source.loopStart = options['loopStart'] || 0; + source.loopEnd = options['loopEnd'] || 0; } else { setTimeout(function() { Q.audio.removeSound(soundID); diff --git a/lib/quintus_sprites.js b/lib/quintus_sprites.js index 37403abb..f6b17174 100644 --- a/lib/quintus_sprites.js +++ b/lib/quintus_sprites.js @@ -678,7 +678,9 @@ Quintus.Sprites = function(Q) { this.trigger('prestep',dt); if(this.step) { this.step(dt); } this.trigger('step',dt); - Q._generateCollisionPoints(this); + if(this.p.points) { + Q._generateCollisionPoints(this); + } // Ugly coupling to stage - workaround? if(this.stage && this.children.length > 0) {