phaser/TS Tests/mobile/fullscreen.html
2013-08-28 07:02:57 +01:00

62 lines
No EOL
1.2 KiB
HTML

<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1 maximum-scale=1 user-scalable=0" />
<title>Phaser Mobile Fullscreen Test</title>
<style>
body {
padding: 0;
margin: 0;
}
</style>
<script src="../phaser.js"></script>
</head>
<body>
<div id="game"></div>
<script type="text/javascript">
var myGame = new Game(this, 'game', 320, 200, init, create, update);
function init() {
myGame.stage.fullscreen.go();
myGame.loader.addImageFile('backdrop1', '../assets/pics/atari_fujilogo.png');
myGame.loader.addImageFile('backdrop2', '../assets/pics/acryl_bladerunner.png');
myGame.loader.load();
}
var pic1;
var pic2;
function create() {
pic1 = myGame.createSprite(0, 0, 'backdrop1');
pic2 = myGame.createSprite(0, 0, 'backdrop2');
}
function update() {
if (myGame.stage.fullscreen.isLandscape == true)
{
pic1.visible = true;
pic2.visible = false;
}
else
{
pic2.visible = true;
pic1.visible = false;
}
}
</script>
</body>
</html>