[SensorBall]update SensorBall
authorgs86.lee <gs86.lee@samsung.com>
Tue, 23 Apr 2013 08:48:29 +0000 (17:48 +0900)
committergs86.lee <gs86.lee@samsung.com>
Tue, 23 Apr 2013 08:48:29 +0000 (17:48 +0900)
Change-Id: I4eff5837cce8f5caaf10aac5cabf62a0e7eeb1e5

config.xml
icon.png
js/main.js

index 170458f..11551fe 100644 (file)
@@ -1,11 +1,16 @@
 <?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>
index 983c883..33fbb63 100755 (executable)
Binary files a/icon.png and b/icon.png differ
index 77b213b..8106633 100644 (file)
@@ -114,6 +114,7 @@ var app = {
 
                $('#sun').css('left', this.sunX + 'px');
                $('#sun').css('top', this.sunY + 'px');
+               $('#sun').show();
        },
 
        /**
@@ -435,7 +436,7 @@ var app = {
                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;
@@ -481,14 +482,17 @@ $(document).ready(function () {
        });
 
        $('#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();
        });
 
@@ -499,4 +503,9 @@ $(document).ready(function () {
        // 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