phaser/examples/_site/js/phaser-viewer.js
photonstorm 8662cd2fd4 Brand new Grunt task - creates each core library as its own file and a combined phaser.js.
New build script now cleanly splits Phaser, Pixi and p2 so they are each UMD wrapped and each available in the global scope (now more requireJS friendly!).
phaser-no-libs.js allows you to use your own version of p2.js or pixi.js with Phaser. Warning: This is totally unsupported. If you hit bugs, you fix them yourself.
Fixed silly instanceof bug in game objects (sorry guys).
2014-02-28 09:30:53 +00:00

69 lines
1.2 KiB
JavaScript

$(document).ready(function(){
var dir = $.url().param('d');
var file = $.url().param('f');
var title = $.url().param('t');
document.title = 'phaser - ' + title;
$("#title").append(title);
$.getScript(dir + "/" + file)
.done(function(script, textStatus) {
$.ajax({ url: dir + "/" + file, dataType: "text" }).done(function(data) { $("#sourcecode").text(data); });
// Hook up the control panel
$(".pause-button").click(function() {
if (game.paused)
{
game.paused = false;
}
else
{
game.paused = true;
}
});
$(".mute-button").click(function() {
if (game.sound.mute)
{
game.sound.mute = false;
}
else
{
game.sound.mute = true;
}
});
$(".reset-button").click(function() {
document.location.reload(true);
});
})
.fail(function(jqxhr, settings, exception) {
$("#title").text("Error");
var node = '<p>Unable to load <u>' + dir + '/' + file + '</u></p>';
$('#phaser-example').append(node);
});
$.getJSON("http://phaser.io/version.json")
.done(function(data) {
if (data.version !== '2.0.0')
{
$("#upgrade").append(data.version);
$("#upgrade").css('display', 'inline-block');
}
});
});