------

[ AD ] Port Monitor ( Try to use a Best WebSite Monitoring Tool )

------
HTML 5 규격 과 특징 ( 샘플 코드 ) in BADA / Webkit

HTML5는 

그것의 특징들은 HTML, CSS, DOM과 JavaScript을 기반을 두고 있고
외부 플러그인을 위한 필요한것들을 감소 시키며 ,
더 나은 에러 처리, 스크립을 감소 시켜주는 더 많은 마크업,
장치에 비의존적 ,
개발 과정이 눈으로 확인하며 공개
 

How HTML5 makes easy?

HTML5 makes easy because its features are based on HTML, CSS, DOM, and JavaScript, reduces the need for external plug-ins (like Flash), better error handling, more markup to replace scripting , device independent, the development process should be visible to the public


새로운 특징

- 그리는 것을 위한 캔버스 요소
- 미디어 실행을 위한 비디오 와 오디오 요소
- 지연 비연결 저장소를 위한 더 나은 지원
- 새로운 컨텐츠 특정 요소, 기사와 같이, 꼬리말, 머리말, nav, section
- 새로운 폼 컨트롤, 달력과 같은 , 일자, 시간, 이메일, URL, 검색

New Features
•The canvas element for drawing
•The video and audio elements for media playback
•Better support for local offline storage
•New content specific elements, like article, footer, header, nav, section
•New form controls, like calendar, date, time, email, URL, search


New Markup Elements

Tag
Description

<article>
For external content, like text from a news-article, blog, forum, or any other content from an external source
<aside>
For content aside from the content it is placed in. The aside content should be related to the surrounding content
<command>
A button, or a radio button, or a checkbox
<details>
For describing details about a document, or parts of a document
<summary>
A caption, or summary, inside the details element
<figure>
For grouping a section of stand-alone content, could be a video
<figcaption>
The caption of the figure section
<footer>
For a footer of a document or section, could include the name of the author, the date of the document, contact information, or copyright information
<header>
For an introduction of a document or section, could include navigation
<hgroup>
For a section of headings, using <h1> to <h6>, where the largest is the main heading of the section, and the others are sub-headings
<mark>
For text that should be highlighted
<meter>
For a measurement, used only if the maximum and minimum values are known
<nav>
For a section of navigation
<progress>
The state of a work in progress
<ruby>
For ruby annotation (Chinese notes or characters)
<rt>
For explanation of the ruby annotation
<rp>
What to show browsers that do not support the ruby element
<section>
For a section in a document. Such as chapters, headers, footers, or any other sections of the document
<time>
For defining a time or a date, or both
<input type=’file’>
file browsing


New Media Elements 미디어 요소 / 오디오, 비디오

Tag
Description
<audio>
For multimedia content, sounds, music or other audio streams
<video>
For video content, such as a movie clip or other video streams
<source>
For media resources for media elements, defined inside video or audio elements
<embed>
For embedded content, such as a plug-in


<VIDEO width="640" height="360" preload="none" controls>

<SOURCE type="video/mp4" src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4" />
<SOURCE type="video/webm" src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.webm" />
<SOURCE type="video/ogg" src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.ogv" />

<object width="640" height="384" type="application/x-shockwave-flash" data="/code/video_for_everybody/player.swf">

<param name="movie" value="/code/video_for_everybody/player.swf" />
<param name="flashvars"
value="image=/code/video_for_everybody/poster.jpg&amp;file=http://clips.vorwaerts-mbh.de/big_buck_bunny.mp4" />
<img src="/code/video_for_everybody/poster.jpg" width="640" height="360" alt="Big Buck Bunny"
title="No video playback capabilities, please download the video below" />

</object>

The Canvas Elements / 캔버스

Tag
Description

<canvas>
For making graphics with a script

<canvas id="myCanvas" width="200" height="100" style="border:1px solid #c3c3c3;">
Your browser does not support the canvas element.
</canvas>

<input type="button" value="Create Graphics" onclick="draw();"/>
<script type="text/javascript">
 function draw(){
    var canvas=document.getElementById("myCanvas");
    if(!canvas.getContext){return;}

    var ctx=canvas.getContext("2d");

    ctx.beginPath();
    ctx.arc(75,75,50,0,Math.PI*2,true); // Face 얼굴
    ctx.moveTo(110,75);

    ctx.arc(75,75,35,0,Math.PI,false); // Mouth
    ctx.moveTo(65,65);

    ctx.arc(60,65,5,0,Math.PI*2,true); // Left eye
    ctx.moveTo(95,65);

    ctx.arc(90,65,5,0,Math.PI*2,true); // Right eye
    ctx.stroke();}
</script>


New Form Elements

Tag
Description

<datalist>
A list of options for input values
<keygen>
Generate keys to authenticate users
<output>
For different types of output, such as output written by a script

New Input Type Attribute values
Tag

Description
tel
The input value is of type telephone number
search
The input field is a search field
url
The input value is a URL
email
The input value is one or more email addresses
datetime
The input value is a date and/or time
date
The input value is a date
month
The input value is a month
week
The input value is a week
time
The input value is of type time
datetime-local
The input value is a local date/time
number
The input value is a number
range
The input value is a number in a given range
color
The input value is a hexadecimal color, like #FF8800

<script type="text/javascript">
    function write_sum(){
      x=5;
      y=3;
      document.forms["sumform"]["sum"].value=x+y
    }
</script>

</head>

<body bgcolor="#DEB887">
<div style="overflow:scroll;height:400px;width:350px;">

<article>
    <a href="http://blog.netscape.com/2007/12/28/end-of-support-for-netscape-web-browsers">
    Netscape is dead</a>
    <br />
     AOL has a long history on the internet, being one of
     the first companies to really get people online.....
</article>

<aside>
    <h4>Epcot Center</h4>
           The Epcot Center is a theme park in Disney World, Florida.
</aside>

<menu>
     <command type="command">Click Me!</command>
</menu>

<details>
       <summary>HTML 5</summary>
        This document teaches you everything you have to learn about HTML 5.
</details>

<figure>
    <h1>WWF</h1>
    <p>The World Wildlife Foundation was born in 1961...</p>
</figure>

<figure>
     <figcaption>WWF</figcaption>
     <p>The World Wildlife Foundation was born in 1961...</p>
</figure>

<footer>This document was written in 2009</footer>

<header>
     <h1>Welcome to my homepage</h1>
     <p>My name is Donald Duck</p>
</header>

<hgroup>
     <h1>Welcome to my WWF</h1>
     <h2>For a living planet</h2>
</hgroup>

<p>Do not forget to buy <mark>milk</mark> today.</p>
     <meter min="0" max="10">2</meter><br />
      <meter>2 out of 10</meter><br />
     <meter>20%</meter>

<nav>
     <a href="default.asp">Home</a>
     <a href="tag_meter.asp">Previous</a>
     <a href="tag_noscript.asp">Next</a>
</nav>

The object's downloading progress:
<progress>
     <span id="objprogress">76</span>%
</progress>

<section>
     <h1>WWF</h1>
     <p>The World Wildlife Foundation was born in 1961...</p>
</section>

<p>We open at <time>10:00</time> every morning.</p>

<p>I have a date on <time datetime="2008-02-14">Valentine’s day</time></p>

<input list="cars" />
    <datalist id="cars">
        <option value="BMW">
        <option value="Ford">
        <option value="Volvo">
     </datalist>

<form action="form_action.asp" method="get" name="sumform">
     <output name="sum"></output>
</form>

<keygen type="rsa"></keygen>
</div>

<body>
</html>


Geo-location using HTML5


function showMap(position) {
     alert(position.coords.latitude, position.coords.longitude);
    document.getElementById('latitude').innerHTML = position.coords.latitude;
    document.getElementById('longitude').innerHTML = position.coords.longitude;
}

// One-shot position request.

navigator.geolocation.getCurrentPosition(showMap);

Web Storage
•Local Storage - Stores data with no time limit
•Session Storage - Stores data for one session

Local Storage Method:
Local Storage sets fields on the domain. Even when you close the browser, reopen it, and go back to the site. The values are stored in the local storage.

Session Storage Method:
The Session Storage sets fields on the window. When the window is closed, the session fields are lost, even if the site remains open in another window.

Local Storage
localStorage.lastname="Smith";
document.write(localStorage.lastname);

Session Storage
sessionStorage.lastname="Smith";
document.write(sessionStorage.lastname);




Drag and Drop


var eat = ['yum!', 'gulp', 'burp!', 'nom'];

var yum = document.createElement('p');
var msie = /*@cc_on!@*/0;
yum.style.opacity = 1;
var links = document.querySelectorAll('li > a'), el = null;

for (var i = 0; i < links.length; i++) {
    el = links[i];
    el.setAttribute('draggable', 'true');
    addEvent(el, 'dragstart', function (e) {
    e.dataTransfer.effectAllowed = 'copy'; // only dropEffect='copy' will be dropable
    e.dataTransfer.setData('Text', this.id); // required otherwise doesn't work
});
}
var bin = document.querySelector('#bin');

addEvent(bin, 'dragover', function (e) {
    if (e.preventDefault) e.preventDefault(); // allows us to drop
    this.className = 'over';
    e.dataTransfer.dropEffect = 'copy';
    return false;
});

// to get IE to work
addEvent(bin, 'dragenter', function (e) {
    this.className = 'over';
    return false;
});

addEvent(bin, 'dragleave', function () {
    this.className = '';
});

addEvent(bin, 'drop', function (e) {
    if (e.stopPropagation) e.stopPropagation(); // stops the browser from redirecting...why???
    var el = document.getElementById(e.dataTransfer.getData('Text'));
    el.parentNode.removeChild(el);
    // stupid nom text + fade effect
    bin.className = '';
    yum.innerHTML = eat[parseInt(Math.random() * eat.length)];


var y = yum.cloneNode(true);
bin.appendChild(y);

setTimeout(function () {
    var t = setInterval(function () {
     if (y.style.opacity <= 0) {
        if (msie) { // don't bother with the animation
            y.style.display = 'none';
        }
        clearInterval(t);
      } else {
        y.style.opacity -= 0.1;
      }
     }, 50);
   }, 250);
   return false;
});



안드로이드 예제 따라하기 / 소스 분석하기 ///

안드로이드 SDK는 여러가지 샘플을 제공한다.
응용 프로그램 이름
설명
Snake
비트맵 그리기와 키 입력 사건의 처리 방법을 보여주는 간단한 게임
NotePad
데이터 베이스 접근 방법을 보여주는 간단한 목록 응용 프로그램
LunarLander
그래픽과 애니메이션을 보여주는 간단한 게임
JetBoy
Asteroid류의 간단한 액션 게임으로, 상호작용적인 음악 엔진 SONiVOX Jjet의 사용법을 보여준다. 이에 대한 자세한 사항은 안드로이드 개발자 가이드의 SONiVOX JET Creator User Manual항목에서 볼 수 있다
SoftKeyboard
화면상의 소프트웨어 키보드로, 커스텀 입력기 구현방법을 보여준다.
ApiDemos
사용자 인터페이스 위젯에서부터 서비스, 경보(Alarm), 알림 같은 응용 프로그램 수명주기 구성요소들에 이르기까지 다양한 안드로이드 API들을 시연하는 메뉴 기반 유틸리티이

Snake




**************setting 프로젝트 정보 설정 하기



************ 실행 환경 설정 하기




**************** Run 실행



안드로이드 예제 폴더



http://urajilator.tistory.com/459


www.iconarchive.com


www.freeicondownload.com


www.freeiconsweb.com


안드로이용 icon 무료 이미지 받기





 

[안드로이드] apk 설치하는 방법


apk설치에 안드로이드 버전은 의미가 없지만, 알려드리는 환경은 2.1기반의 디자이어임을 안내 드립니다. 버전과 기기와 무관하게 모든 apk파일은 다음과 같이 사용하시면 됩니다


5. APK파일을 핸드폰으로 옮기기

데스크탑의 APK파일을 안드로이드핸드폰으로 옮기는 방법은 수십가지가 있겠지만 가장 노말한 USB로 넘겨보도록 하죠. 다시 한 번 말씀드리지만 APK파일을 압축프로그램(알집 등)으로 절대로 절대로 풀지마세요!!!

-1)USB연결
기기에 따라 USB 연결 방법이 다릅니다. 기기의 사용 설명서를 참고하시기 바랍니다. (아래는 디자이어 기준)
Image Hosted by ImageShack.us
-2) 윈도우 탐색기에서 APK파일을 USB로 옮깁니다. 이 곳 저 곳에 아무렇게나 두지 마시고 GAME이든 UTIL이든 폴더를 만들어서 관리하시기 바랍니다.
Image Hosted by ImageShack.us
-3) USB연결을 해제하고 핸드폰에서 탐색기를 실행합니다.(디자이어의 경우 USB로 연결한 상태에서는 SD카드를 인식하지 못하므로 USB연결을 반드시 해제하셔야 SD카드를 다시 마운트=인식 합니다.) 저는 아스트로 탐색기를 주탐색기로 설치해서 사용하고 있습니다.
Image Hosted by ImageShack.us
-4)아스트로 탐색기 실행 후 해당 경로까지 이동해 봅시다. 별로 어렵지 않아요 폴더를 찾아서 들어가면 됩니다.(본인이 USB로 파일을 옮겨 놓은 곳을 기억해야겠죠)
Image Hosted by ImageShack.us
-5)APK파일 속에 어플리케이션의 썸네일(작은 이미지)도 들어 있어서 시각적으로도 확인이 가능하죠. 옮겨 놓은 파일이 맞다면 클릭 후 앱관리자를 열어서 "설치"를 눌러주시면 됩니다.
Image Hosted by ImageShack.us

어려운 내용도 아니고 난이도가 있는 것도 아닙니다. 단지 APK파일을 압축해제하지 마시고 USB로 제대로 옮겨놓은 후 해당경로까지 찾아가서 설치하시면 됩니다. 다음번 포스팅에서는 프로그램 삭제하는 방법에 대해서 뵙도록 하지요..


http://www.uccp.biz/556

Features 특징

  • Rich User Interface 풍부한 사용자 
  • Impressive Animations 인상적인 애니메이션
  • Professional Software Development 전문적인 소프트웨어 개발
  • Reusing Code between Platforms 플랫폼과 코드 재새용
  • Full Localization Support 모든 지역화 지원
  • Access to Hardware & System APIs 하드웨어와 시스템 API 접근
  • Platform Specific Optimization 플랫폼 독립적 최적화
  • Integration of Native SDKs 원시 개발킷의 통합
  • API Viewer & Unit Testing Integrated 개발접근규약 보기와 모듈 테스팅 통합

Benefits

  • Reduced Costs 원가 줄이기
  • Improved Time-2-Market 시장출시 시간 향상
  • Wide Platform Support 광범위한 플랫폼 지원
  • Reusing Code between Platforms  플랫폼간 코드 재사용
  • Many Available Web Developers 많은 참여 가능한 웹개발자
  • Quickly Improving Technology 기술을 빠르게 향상



Unify Events

JSConf.EU

25.+26. September 2010

Unify goes OpenSource

JavaScript User Group Frankfurt

30. September 2010

Presentation of Unify Framework

Innovation Day of Deutsche Telekom

07. October 2010

Unify is part of the show

RIA World München

10.-11. November 2010

Presentation of Unify Framework

Roadmap

Unify 0.5 (in Q4/2009)
iOS 3.x.
Unify 1.0 (in Q3/2010)
added support for iOS 4.x
added support for Android 2.x.
added support for WebOS 1.x.
Unify 1.1 (planned for Q1/2011)
planned to support BlackBerry OS 6.0
Unify 1.5 (planned for Q3/2011)
planned to offer UI components for tablet devices
planned to support Symbian 3.x. (via Qt Web Runtime)
planned to support MeeGo (via Qt Web Runtime)
planned to support Bada (via PhoneGap)
Unify 2.0 (planned for Q4/2011)
planned to support Windows Phone (via IE 9 engine)



2010 9 25/26

2010 9 25 Day 1
Speaker(s) Topic
THEATRE (TRACK A)
Dion Almaer & Ben Galbraith Using the Web to deliver the next wave of computing experiences
Peter Higgins Your library sucks, and why you should use it
Jenn Lukas JavaScript + Web Standards II: The Quickening
Tim Caswell Techniques and Tools for Taming Tangled Twisted Trains of Thought (PDF)
Ulrike Müller Server-side JavaScript the untold story
Nicole Sullivan CSS Lint for Massive Sites
Brian LeRoux PhoneGap: Love the Web and Lose the SDK
Ben Firshman Lessons learnt pushing browsers to the limit (links: 1 2 3 4)
Mutwin Kraus Using canvas to develop classic 2D games
Rebecca Murphy The jQuery Divide
Pete LePage Chakra: Building A New JavaScript Engine For Internet Explorer 9
/be (Brendan Eich) Proxies are Awesome!

MUSIC SCHOOL (TRACK B)
Robert Nyman HTML5 APIs - The new Frontier
Nicolas Garcia Belmonte Creating Interactive Data Visualizations for the Web
Sebastian Deutsch & Stephan Seidt If it moves they will watch (sample code)
Paul Bakaus Aves Engine: High performance browser games
Mikeal Rogers node.js + CouchDB == Crazy Delicious
Felix Geisendörfer Dirty NoSQL (code, blog)
Philip Hofstetter node.js in production use: tempalias.com
Markus Franz Better Life with shared resources
Joe McCann Rapid Prototyping for Multiple Platforms with JavaScript
Fabian Jakobs Kick ass code editing and end-to-end Javascript debugging


개발 도구


  • Transformie: provides CSS Transforms for Internet Explorer by mapping the native IE filter API
    CSS 변형


  • Transloadit: cool new service to provide robust file uploading (with image resizes, video encoding, etc) 
     
  • Cloud9 IDE (by Javascripters, for Javascripters)
    자바스크립터에 의한, 자바스크립터를 위한

 Cloud9 IDE is aiming to be the IDE for Javascript developers.
We have all experienced the Eclipse variants and other Java or C++ IDE's for which
webdevelopment and javascript was an afterthought.

Extending these applications or customizing them to our needs was done in either Java or C++ and generally very difficult.

We are developing applications in javascript to run online for a purpose,
why shouldn't you do your application development online too?

For these reasons we have started Cloud9 IDE as an online platform for Javascript development,
and all the code is opensource and free to adapt and use.

 

  • Unify: single-stack project for developing cross-platform, native-looking mobile apps
    단일 프로젝트 교차플랫폼(멀티 플랫폼) , 모바일 앱으로 만든것처럼 보이게

Native-like applications for smartphones, tablets and desktops

Unify was built to improve the development efficiency of apps for smartphones.
Currently it supports smartphones based on the platforms iOS, Android and WebOS.

There is support for deskop operating systems like Windows or Mac OS as well.
Support for tablet devices is planned for the next year.

The software makes use of a whole range of modern web technologies such as HTML5, CSS3 and JavaScript.

A typical end user should not be able to distinguish an application built with Unify from a natively programmed application.

Unify bypasses the traditional limitations of the web browser. Detecting the current geo location, accessing the file system, etc. is easy to implement.

Unify is made available under a dual license: MIT + Apache, Version 2.0 

 

 

  • soca: Sammy on Couch App nodestream: Realtime apps made easy with templating


2010 9 26  Day2

Speaker(s) Topic
THEATRE (TRACK A)
Douglas Crockford Loopage
Jens Arps The hitchhiker's guide to client side persistent data storage
Ryan Dahl Techniques for a single stack world
Jed Schmidt Getting functional with (fab)
Tom Hughes-Croucher Don't write spaghetti code in server side JavaScript
Kevin Dangoor, Joe Walker & Patrick Walton BespinSkywriter: The JavaScript Programmer's Editor
Jörn Zaefferer & Nikolai Onken Robotic JavaScript
Mark Wubben Browser Extensions for Web Hackers (code)
Alexander Lang Not your unit test (note: Chrome on OS X)
Stoyan Stefanov Performance Patterns
Chris Williams (JSConf co-creator) Community.js

MUSIC SCHOOL (TRACK B)
Paul Irish The State of HTML5 : Inaugural Address (note: Webkit/Chrome required) (sidebar on polyfills)
Tobias Schneider Not your Mother's JavaScript!
Sebastian Werner Introducing Unify - A Framework for Cross Platform Applications
Guillermo Rauch Socket.IO: Web Sockets for Everyone (nodestream, demo)
Thomas Steiner Pirating the Semantic Web with JavaScript
Rotislav Hristov The Art of deep linking and AJAX crawling
Kris Kowal CommonJS, I Promise
Aaron Quint The Front-end Takeover
John David Dalton Srsly R1pp3d J@vaScript
embedJS team What is embedJS (I don't see this one on the schedule, only in the Twitter stream; where was it?)


http://goo.gl/UDei


  • Setup the Development Environment
  • Create a "Hello World" Android Application
  • Understand the various parts of an Android Project
  • Use the Android Emulator
  • Install and run the application on a physical device
  • Create a simple User Interface
  • Activities


    1. Setting Up the Development Environment


    1.1 Download/Install the SDK

    1.2 Download/Install the Eclipse Plugin
    1.3 Download/Install the SDK Platform Components

    2. Create "Hello World" Application


    2.1 Create a new Android Project
    3. Take a Tour of the Application

     
    4. Run "Hello World" on the Emulator


    4.1 On the Emulator
    4.2 On a Physical Device

    • Project Modifications
      • From the Package Explorer double-click the file AndroidManifest.xml.

      • Select the tab labeled AndroidManifest.xml along the bottom.

      • Add  android:debuggable="true"  to the inside of the opening <application> tag.

      • Save the file and close it.
    • Phone Modifications
      • Turn the phone on.

      • Navigate to the Home screen.

      • Press MENU (the physical button on the device).

      • Select Settings -> Applications -> Development.

      • Enable the USB debugging"option.

    5. Simple Activity Classes

    There are four major types of component classes in any Android application:
    • Activities: Much like a Form for a web page, activities display a user interface for the purpose of performing a single task. An example of an Activity class would be one which displays a Login Screen to the user.

    • Services: These differ from Activities in that they have no user interface. Services run in the background to perform some sort of task. An example of a Service class would be one which fetches your email from a web server.

    • Broadcast Receivers: The sole purpose of components of this type is to receive and react to broadcast announcements which are either initiated by system code or other applications. If you've ever done any work with Java Swing, you can think of these like Event Handlers. For example, a broadcast announcement may be made to signal that a WiFi connection has been established. A Broadcast Receiver for an email application listening for that broadcast may then trigger a Service to fetch your email.

    • Content Providers: Components of this type function to provide data from their application to other applications. Components of this type would allow an email application to use the phone's existing contact list application for looking up and retrieving email address.

      Lectures

     Topics  Slides
     Overview, Context  GettingStarted.ppt
     App Basics  AppBasics.ppt
     UI Overview, Activities, Application Lifecycle  ApplicationLifecycle.ppt
     Intents, Intent Filters, Broadcasts, BroadcastReceivers  IntentsBroadcastReceivers.ppt
     Shared Preferences, Files, SQLite DB, Content Provider  Persistence.ppt
     Automated testing, Test-Driven Development  TDD.ppt
     Google Maps, MapView, MapActivity  Maps.ppt
     Threads, Services, Status Bar Notifications  ThreadsServices.ppt
     Deployment to Market, Monetization  Deployment.ppt


    /* by 구글 Google Code University */

    이 웹사이트는 CS 학생과 교사가 현재의 컴퓨팅 기술 및 패러다임에 대해 자세히 알아볼 수 있도록 자습서 및 과정 콘텐츠 샘플을 제공합니다. 특히 이 콘텐츠는 Creative Commons 라이센스가 있으므로 CS 교사들이 교육 현장에서 쉽게 사용할 수 있습니다.

    과정 섹션에는 다음과 같은 다양한 주제 영역에 대한 자습서, 강의 슬라이드 및 문제 집합이 들어 있습니다.

    • AJAX 프로그래밍
    • 알고리즘
    • 분산 시스템
    • 웹 보안
    • 언어

    도구 101 섹션에서는 버전 제어 시스템 및 데이터베이스와 같이 컴퓨터 공학에서 사용되는 몇 가지 일반적인 도구에 대한 소개를 볼 수 있습니다.

    CS 커리큘럼 검색은 전 세계 CS 학과의 교직원들이 웹에 게시한 교육 자료를 찾는 데 도움이 됩니다. 과정에 대해 강의, 과제물 또는 참고 자료만을 표시하도록 검색 범위를 제한할 수 있습니다.


    Using Modifiers  -- Rokon Game Engine
    public class ColorModifier extends Modifier {
    
    	private float color;
    
    	@Override
    	public void onStart(Sprite sprite) {
    		color = 0;
    	}
    
    	@Override
    	public void onUpdate(Sprite sprite) {
    		// Here you can do anything to the sprite, like move it or whatever.
    		// But we will just do a simple color modification.
    		sprite.setRGB(1, color, color);
    		color += 0.1;
    
    		// When the sprite's original colors has been restored, end it.
    		if (color >= 1)
    			end();
    	}
    
    	@Override
    	public void onEnd(Sprite sprite) {		sprite.setRGB(1, 1, 1);
    	}
    
    }
    
    

    	private ColorModifier modifier;
    
    	public GameScene() {
    		super(1, 1);
    
    		setBackground(background = new FixedBackground(Textures.background));
    
    		// Create the Bob sprite
    		bob = new Sprite(100, 220, Textures.bob.getWidth(), Textures.bob.getHeight());
    		bob.setTexture(Textures.bob);
    
    		// Add the Bob sprite to the first layer.
    		add(0, bob);
    
    		// And create the modifier.
    		modifier = new ColorModifier();
    	}
    
    	@Override
    	public void onGameLoop() {
    	}
    
    	@Override
    	public void onTouchUp(float x, float y, MotionEvent event, int pointerCount, int pointerId) {
    		// Add your modifier to the sprite.
    		bob.addModifier(modifier);
    	}
    
    

    public GameScene() {
        super(1, 1);
    
        setBackground(background = new FixedBackground(Textures.background));
    
        // Create the Bob sprite.
        bob = new Sprite(100, 220, Textures.bob.getWidth(), Textures.bob.getHeight());
        bob.setTexture(Textures.bob);
    
        // Add the Bob sprite to the first layer.
        add(0, bob);
    }
    
    

    @Override
    public void onTouchDown(float x, float y, MotionEvent event, int pointerCount, int pointerId) {
    	// This is called when you press down on the screen.
    }
    
    @Override
    public void onTouchMove(float x, float y, MotionEvent event, int pointerCount, int pointerId) {
    	// This is called when you move your finger over the screen. (ie pretty much every frame if your holding your finger down)
    
    	// Here we'll just make Bob follow your finger.
    	bob.x = x - (Textures.bob.getWidth() / 2);
    	bob.y = y - (Textures.bob.getHeight() / 2);
    }
    
    @Override
    public void onTouchUp(float x, float y, MotionEvent event, int pointerCount, int pointerId) {
    	// And this is called when you stop pressing.
    }
    
    


    The first and second parameters are the x and y positions of where you press (duh),
    and the third is the actual event send by android if you happen to need that,
     then the last two are only used if you target android 2.1 or up,
    'pointerCount' is the amount of fingers the user is currently holding down
    and 'pointerId' is which of them this event is for.

    And then in 'onTouchMove()' we just set Bob's position to be where you're pressing.
    (to see that it actually works)
    (The width/2 and height/2 are just to make it centered)
    텍스쳐 로딩
    		//TextureAtlas 
    		atlas = new TextureAtlas();
    		
    		/**
    		 * Here we’ll add the background texture to our atlas.
    		 * (note that it’s recommended to add the textures 
    		 * in order of size, ie add the biggest one first, 
    		 * and the smallest one last)
    
    		 */
    		background = new Texture("background.png");
    		atlas.insert( background );
    		bob = new Texture("bob.png");
    		atlas.insert( bob );
    		/**
    		 * 
    		 * This marks the atlas as complete, meaning that after you call this, 
    		 * you cannot add any more textures to the atlas.
    
    		 */
    		atlas.complete();
    

    게임 화면
    	public GameScene() {
    		/**
    		 *  ‘super()’ to ‘super(1, 3)’, this means that 
    		 *  we’re only going to use 1 layer of sprites with 3 sprites on it.
    		 */
    		super(1,3);
    		// TODO Auto-generated constructor stub
    		background = new FixedBackground(Textures.background);
    		setBackground(background);
    		
    		// Create the Bob sprites.
    	    bob1 = new Sprite(100, 220, Textures.bob.getWidth(), Textures.bob.getHeight());
    	    bob1.setTexture(Textures.bob);
    	    bob2 = new Sprite(100, 180, Textures.bob.getWidth(), Textures.bob.getHeight());
    	    bob2.setTexture(Textures.bob);
    	    bob3 = new Sprite(100, 260, Textures.bob.getWidth(), Textures.bob.getHeight());
    	    bob3.setTexture(Textures.bob);
    	    
    	    // Add the Bob sprites to the first layer.
    	    add(0, bob1);
    	    add(0, bob2);
    	    add(0, bob3);
    
    
    	}
    	@Override
    	public void onGameLoop() {
    		// TODO Auto-generated method stub
    	    bob1.x += 1;
    
    	    if (bob1.x >= MainActivity.GAME_WIDTH)
    	    {
    	        bob1.x = 0;
    	    }
    
    	    bob2.rotate(2);
    
    		
    	}
    
    	@Override
    	public void onPause() {
    		// TODO Auto-generated method stub
    
    	}
    
    	@Override
    	public void onReady() {
    		// TODO Auto-generated method stub
    		 bob3.moveTo(450, 100, 5000);
    
    	}
    
    	@Override
    	public void onResume() {
    		// TODO Auto-generated method stub
    
    	}
    
    	
    


    + Recent posts