mirror of
https://github.com/wassname/phaser.git
synced 2026-08-03 13:10:25 +08:00
Canvas and Stage added and starting to merge in Pixi deeply.
This commit is contained in:
+1
-3
@@ -13,10 +13,8 @@
|
||||
// Your game will work either from within a closure or not, it doesn't matter
|
||||
(function () {
|
||||
|
||||
var game = new Phaser.Game(800, 600, Phaser.RENDERER_AUTO, '', { preload: preload, create: create });
|
||||
|
||||
// In this approach we're simply using functions in the current scope to do what we need
|
||||
// game.launch(this, preload, create);
|
||||
var game = new Phaser.Game(800, 600, Phaser.RENDERER_AUTO, '', { preload: preload, create: create });
|
||||
|
||||
function preload() {
|
||||
|
||||
|
||||
+2
-1
@@ -37,7 +37,7 @@
|
||||
<script src="../src/pixi/textures/BaseTexture.js"></script>
|
||||
<script src="../src/pixi/textures/Texture.js"></script>
|
||||
<script src="../src/pixi/textures/RenderTexture.js"></script>
|
||||
<script src="../src/pixi/utils/Detector.js"></script>
|
||||
<!--<script src="../src/pixi/utils/Detector.js"></script>-->
|
||||
<script src="../src/pixi/utils/EventTarget.js"></script>
|
||||
<script src="../src/pixi/utils/Polyk.js"></script>
|
||||
<script src="../src/pixi/utils/Utils.js"></script>
|
||||
@@ -65,4 +65,5 @@
|
||||
<script src="../src/animation/Parser.js"></script>
|
||||
<script src="../src/loader/Cache.js"></script>
|
||||
<script src="../src/loader/Loader.js"></script>
|
||||
<script src="../src/Stage.js"></script>
|
||||
<script src="../src/Game.js"></script>
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>phaser.js - a new beginning</title>
|
||||
<?php
|
||||
require('js.php');
|
||||
?>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
(function () {
|
||||
|
||||
// In this approach we're simply using functions in the current scope to do what we need
|
||||
var game = new Phaser.Game(800, 600, Phaser.RENDERER_AUTO, '', { preload: preload, create: create });
|
||||
|
||||
function preload() {
|
||||
|
||||
console.log('*** preload called');
|
||||
game.load.image('cockpit', 'assets/pics/cockpit.png');
|
||||
game.load.image('overdose', 'assets/pics/lance-overdose-loader_eye.png');
|
||||
|
||||
}
|
||||
|
||||
function create() {
|
||||
|
||||
console.log('*** create called');
|
||||
document.body.appendChild(game.cache.getImage('cockpit'));
|
||||
|
||||
}
|
||||
|
||||
})();
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user