<?xml version="1.0" encoding="UTF-8"?>
-<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://sample-web-application.tizen.org/SensorBall" version="2.1.0" viewmodes="fullscreen">
- <tizen:application id="RiIuG1b0CV.SensorBall" package="RiIuG1b0CV" required_version="2.1"/>
- <content src="index.html"/>
- <icon src="icon.png"/>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets"
+ id="http://sample-web-application.tizen.org/SensorBall" version="2.1.0"
+ viewmodes="fullscreen">
+ <tizen:application id="RiIuG1b0CV.SensorBall"
+ package="RiIuG1b0CV" required_version="2.1" />
+ <content src="index.html" />
+ <icon src="icon.png" />
<name>SensorBall</name>
- <tizen:privilege name="http://tizen.org/privilege/application.read"/>
- <tizen:privilege name="http://tizen.org/privilege/application.launch"/>
- <tizen:privilege name="http://tizen.org/privilege/systeminfo"/>
- <tizen:setting screen-orientation="portrait" context-menu="disable" background-support="enable" encryption="disable" install-location="auto"/>
+ <tizen:privilege name="http://tizen.org/privilege/application.read" />
+ <tizen:privilege name="http://tizen.org/privilege/application.launch" />
+ <tizen:privilege name="http://tizen.org/privilege/systeminfo" />
+ <tizen:setting screen-orientation="portrait"
+ context-menu="disable" background-support="enable" encryption="disable"
+ install-location="auto" />
</widget>
$('#sun').css('left', this.sunX + 'px');
$('#sun').css('top', this.sunY + 'px');
+ $('#sun').show();
},
/**
this.current = 'earth';
$('.ball').attr('src', './images/earth.png');
- $('#main').append('<img id="sun" class="sun" src="./images/sun.png"></img>');
+ $('#main').append('<img id="sun" class="sun" src="./images/sun.png" style="display: none;"></img>');
this.sunX = (this.gameWidth - parseInt($('#sun').css('width'), 10)) / 2;
this.sunY = (this.gameHeight - parseInt($('#sun').css('height'), 10)) / 2;
});
$('#btnBall').bind('tap', function (event) {
+ $('#sun').remove();
app.startBall();
});
$('#btnSky').bind('tap', function (event) {
+ $('#sun').remove();
app.startSky();
});
$('#btnSpace').bind('tap', function (event) {
+ $('#sun').remove();
app.startSpace();
});
// Preload backgrounds;
img = $('<img>').hide();
img.attr('src', 'images/background1.png');
+});
+
+$(window).resize(function() {
+ app.gameWidth = $(window).width();
+ app.gameHeight = $('.background').outerHeight();
});
\ No newline at end of file