Lungo has several functions that are used inside its engine. Here you have them if you need to include some of their funcitonality in your application.
Console system to display messages when you are in debug mode.
number: Severity based in (1)Log, (2)Warn, (>2)Error
string: Message to show in the console
Lungo.Core.log(1, "Launched event");
Lungo.Core.log(2, "Warning!!");
Lungo.Core.log(3, "Error!!!!");
Executes callbacks based on the parameters received.
function: callback to execute
var myFunc = function(){
//Do something
};
var myFunc2 = function(){
//Do something
};
Lungo.Core.execute(myFunc, myFunc2);
Creates a new function that, when called, itself calls this function in the context of the provided this value, with a given sequence of arguments preceding any provided when the new function was called.
object: object that 'this' can refer in the new function.
function: A function object.
Return: The function which will do the action on the object.
var example = "This is ";
var addText = function(textToAdd){
text = this;
for(var i = 0, len = textToAdd.length; i < len; i++){
text += " " + textToAdd[i];
}
return text;
};
var text = ["an", "example"];
var finalText = Lungo.Core.bind(example, addText)(text);
//Result: "This is an example"