Skip to content
Open
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
23 changes: 16 additions & 7 deletions lib/quintus.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
};


Expand Down Expand Up @@ -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() {
Expand Down
2 changes: 2 additions & 0 deletions lib/quintus_audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion lib/quintus_sprites.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down