Skip to content

Commit

Permalink
update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
endel committed Jul 8, 2013
1 parent acfc713 commit 85fb8f1
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 22 deletions.
34 changes: 34 additions & 0 deletions examples/core/custom_loader.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Joy Example</title>

<script type="text/javascript" src="../../dist/joy.js"></script>
</head>

<body style="margin: 0; padding: 0;">
<script type="text/javascript">
var engine = new Joy.Engine({width: 320, height: 240});
engine.setSceneLoader(function(scene) {
var progress = new Joy.Text({font: "24px Tahoma", color: "red"});
progress.bind(Joy.Events.UPDATE, function () {
this.text = scene.loader.percentage;
});
scene.addChild(progress)
})

engine.createScene(function(scene) {
scene.addChild(new Joy.Sprite({
x: engine.width / 2,
y: engine.height / 2,
src: "../shared-assets/joyjs.png",
smooth: true
}).bind('load', function (){
this.pivot.x = (this.width / 2);
this.pivot.y = (this.height / 2);
}));
});

</script>
</body>
</html>
1 change: 0 additions & 1 deletion examples/core/hierarchy.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Joy Example</title>

<script type="text/javascript" src="../../dist/sizzle.js"></script>
<script type="text/javascript" src="../../dist/joy.js"></script>
</head>
<body style="margin: 0; padding: 0;">
Expand Down
1 change: 0 additions & 1 deletion examples/core/mouse.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Joy Example</title>

<script type="text/javascript" src="../../dist/sizzle.js"></script>
<script type="text/javascript" src="../../dist/joy.js"></script>
</head>
<body style="margin: 0; padding: 0;">
Expand Down
3 changes: 1 addition & 2 deletions examples/core/pause.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Joy Example</title>

<script type="text/javascript" src="../../dist/sizzle.js"></script>
<script type="text/javascript" src="../../dist/joy.js"></script>
<script type="text/javascript">
var engine, scene;
Expand Down Expand Up @@ -43,7 +42,7 @@
}
})

engine = new Joy.Engine({debug: true, canvas2d: c});
engine = new Joy.Engine({debug: true, canvas: c});
scene = engine.createScene();
scene.background("#BFE5E5");

Expand Down
1 change: 0 additions & 1 deletion examples/core/scenes.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Joy Example</title>

<script type="text/javascript" src="../../dist/sizzle.js"></script>
<script type="text/javascript" src="../../dist/joy.js"></script>
</head>

Expand Down
7 changes: 4 additions & 3 deletions examples/core/shadow.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
<title>Joy Example</title>
<link href='http://fonts.googleapis.com/css?family=Merienda' rel='stylesheet' type='text/css'>

<script type="text/javascript" src="../../dist/sizzle.js"></script>
<script type="text/javascript" src="../../dist/joy.js"></script>
<script type="text/javascript">
function setup() {
Joy.debug = true;
var engine = new Joy.Engine({ canvas2d: document.getElementById("joy") })
var engine = new Joy.Engine({
canvas: document.getElementById("joy"),
debug: true
})
var scene = engine.createScene();

var text = new Joy.Text({
Expand Down
8 changes: 4 additions & 4 deletions examples/core/sprite-sheet.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Joy Example</title>

<script type="text/javascript" src="../../dist/sizzle.js"></script>
<script type="text/javascript" src="../../dist/joy.js"></script>
<script type="text/javascript">
var rufus;
function setup() {
Joy.debug = true;

var engine = new Joy.Engine({ canvas2d: document.getElementById("joy") });
var engine = new Joy.Engine({
canvas: document.getElementById("joy"),
debug: true
});
var scene = engine.createScene();

rufus = new Joy.SpriteSheet({
Expand Down
4 changes: 1 addition & 3 deletions examples/core/sprites-benchmark.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Joy Example</title>

<script type="text/javascript" src="../../dist/sizzle.js"></script>
<script type="text/javascript" src="../../dist/joy.js"></script>
<script type="text/javascript">
function setup() {
Joy.debug = true;
var c = document.getElementById("joy");

function checkBoundaries(s) {
Expand All @@ -26,7 +24,7 @@
}
}

var r = new Joy.Engine({ canvas2d: c }),
var r = new Joy.Engine({ debug: true, canvas: c }),
sprites = [],
total = 1000,
scene = r.createScene();
Expand Down
7 changes: 4 additions & 3 deletions examples/core/sprites.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Joy Example</title>

<script type="text/javascript" src="../../dist/sizzle.js"></script>
<script type="text/javascript" src="../../dist/joy.js"></script>
<script type="text/javascript">
var scene ;

function setup() {
Joy.debug = true;
var c = document.getElementById("joy");

function checkBoundaries(s) {
Expand All @@ -32,7 +30,10 @@
}
}

var engine = new Joy.Engine({ canvas2d: c });
var engine = new Joy.Engine({
canvas: c,
debug: true
});
scene = engine.createScene();

var spriteUrl = "../shared-assets/mario.png";
Expand Down
1 change: 0 additions & 1 deletion examples/core/text.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<title>Joy Example</title>
<link href='http://fonts.googleapis.com/css?family=Merienda' rel='stylesheet' type='text/css'>

<script type="text/javascript" src="../../dist/sizzle.js"></script>
<script type="text/javascript" src="../../dist/joy.js"></script>
</head>
<body style="margin: 0; padding: 0;">
Expand Down
3 changes: 1 addition & 2 deletions examples/core/transformations.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Joy Example</title>

<script type="text/javascript" src="../../dist/sizzle.js"></script>
<script type="text/javascript" src="../../dist/joy.js"></script>
<script type="text/javascript">
function setup() {
Expand Down Expand Up @@ -58,7 +57,7 @@
}
}

var engine = new Joy.Engine({ canvas2d: c });
var engine = new Joy.Engine({ canvas: c });
var scene = engine.createScene();
var spriteUrl = "../shared-assets/mario.png";

Expand Down
1 change: 0 additions & 1 deletion examples/core/viewport.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Joy Example</title>
<script type="text/javascript" src="../../../dist/sizzle.js"></script>
<script type="text/javascript" src="../../../dist/joy.js"></script>
<style type="text/css">
body { margin: 0; padding: 0; zoom: 100%; }
Expand Down

0 comments on commit 85fb8f1

Please sign in to comment.