diff --git a/README.md b/README.md index 9a78d9b..d670056 100644 --- a/README.md +++ b/README.md @@ -246,7 +246,7 @@ Yay, a [black square](http://rampantgames.com/blog/?p=7745)! `PIXI.Application` figures out whether to use the Canvas Drawing API or WebGL to render graphics, depending on which is -available in the web browser you're using. Its argument is a single object called the `options` object. In this example its `width` and `height` properties are set to determine the width and height of the canvas, in pixels. You can set many more optional properties inside this `options` object; here's how you could use it to set anti-aliasing, transparency +available on the web browser you're using. Its argument is a single object called the `options` object. In this example its `width` and `height` properties are set to determine the width and height of the canvas, in pixels. You can set many more optional properties inside this `options` object; here's how you could use it to set anti-aliasing, transparency and resolution: ```js let app = new PIXI.Application({ @@ -450,7 +450,7 @@ app.stage.addChild(cat); ``` Remember that the `stage` is the main container that holds all of your sprites. -**Important: you won't be able to see any of your sprites sprites unless you add them to the `stage`!** +**Important: you won't be able to see any of your sprites, sprites unless you add them to the `stage`!** Before we continue, let's look at a practical example of how to use what you've just learnt to display a single image. In the `examples/images` @@ -1165,7 +1165,7 @@ edge of an adjacent image on the tileset appears next to a sprite. This happens because of the way your computer's GPU (Graphics Processing Unit) decides how to round fractional pixels values. Should it round them up or down? This will be different for each GPU. -Leaving 1 or 2 pixels spacing around images on a tilseset makes all +Leaving 1 or 2 pixels spacing around images on a tileset makes all images display consistently. (Note: If you have two pixels of padding around a graphic, and you still notice a strange "off by one pixel" glitch in the diff --git a/korean ver.md b/korean ver.md new file mode 100644 index 0000000..089e3fb --- /dev/null +++ b/korean ver.md @@ -0,0 +1,2878 @@ +Pixi 사용법 +=========== + +- [Pixi rendering engine]으로 게임과 대화형 미디어를 만드는 단계별 안내.(https://github.com/Bae-hong-seob/learningPixi/blob/develop/korean_ver.md). +- **[Updated for Pixi v4.5.5]. +(https://github.com/pixijs/pixi.js/releases/tag/v4.5.5)**. +- [Chinese version here: Pixi官方教程中文版.](https://github.com/Zainking/learningPixi). +- [이 튜토리얼이 괜찮았다면, 더 많은 내용을 담고 있는 이 책을 추천합니다!] (http://www.springer.com/us/book/9781484210956) + + +### 목차 + +1. [소개](#introduction) + +2. [설정방법](#settingup) + + i. [픽시 설치](#installingpixi) +3. [Stage 및 renderer 생성](#application) +4. [Pixi 속성](#sprites) +5. [텍스처 캐시에 이미지 올리기](#loading) +6. [sprites](#displaying) + + i. [Aliases 사용](#usingaliases) + + ii. [자세한 로딩 방법](#alittlemoreaboutloadingthings) + + - (1). 일반적인 JavaScript Image 객체 또는 Canvas에서 속성 만들기 + - (2). load 된 파일에 이름 지정 + - (3). load 진행과정 모니터링 + - (4). Pixi의 로더에 대한 추가 정보 +7. [속성의 위치 지정](#postioning) +8. [크기와 규모](#size-n-scale) +9. [회전](#rotation) +10. [부가 이미지 모음으로부터 sprite 만들기](#tileset) +11. [텍스처 atlas 사용하기](#texture-atlas) +12. [텍스처 atlas 올리기](#loading-atlas) +13. [올려진 텍스처 atlas 로부터 sprites 만들기](#creating-sprites-from-a-loaded-texture-atlas) +14. [sprites 움직이기](#moving-sprites) +15. [속도의 속성 사용하기](#velocity) +16. [게임 상태](#game-states) +17. [키보드 움직임](#keyboard) +18. [Sprites 그룹화하기](#grouping) + + i. 지역적 및 종합적 위치 + ii. ParticleContainer 를 사용하여 sprite 그룹화하기 +19. [Pixi의 그래픽 기초](#graphic) + + i. 직사각형 + ii. 원 + iii. 타원 + iv. 둥근 사각형 + v. 선 + vi. 다각형 +20. [텍스트 표시](#text) +21. [충돌 감지](#collision) + + i. hitTestRectangle 함수 +22. [사례 연구 : Treasure Hunter ](#casestudy) + + i. setup 기능에서 게임 초기화 + - (1). [게임 장면 만들기](#game-scene) + - (2). [지하 감옥, 문, 탐험가 및 보물 만들기](#making-dungon) + - (3). [얼룩덜룩 한 괴물 만들기](#making-blob) + - (4). [HP표시 바 만들기](#healthbar) + - (5). [메시지 텍스트 만들기](#message) + + ii. 게임하기 + + iii. 탐색기 이동 + + - (1). [움직임 포함](#containing-movement) + iv. 괴물 이동하기 + v. 충돌 확인 + vi. 출구 문에 도달하여 게임을 종료한다. +23. [sprites에 대한 추가 정보](#sprite-properties) +24. [추가 정보](#taking-it-further) + + i. Hexi + ii. BabylonJS +25. [프로젝트 지원]() + + +소개 +----------- +Pixi는 매우 빠른 2D sprite rendering 엔진입니다. 이것은 당신이 JavaScript와 다른 HTML5 기술을 사용하여 게임과 응용프로그램을 쉽게 만들 수 있도록 대화형 그래픽을 표시하고, 애니메이션을 제작 및 관리할 수 있도록 도와줄 수 있습니다. Pixi는 분명 하고, 깔끔한 API를 가지고 있으며 텍스처 atlas를 지원하고 sprite(인터랙티브 이미지)를 나타내기 위한 능률화된 시스템을 제공하는 것과 같은 많은 유용한 기능들을 포함하고 있습니다. 또한 완전한 장면 그래프를 통해 중첩된 sprite(sprite 내부의 sprite)의 계층 구조를 만들 수 있을 뿐 아니라 마우스와 터치를 스프라이트에 직접 연결할 수 있습니다. 그리고 가장 중요한 것은 Pixi는 당신이 원하는 만큼 혹은 더 적게 사용할 수 있도록다, 그리고 그것을 당신의 개인적인 코딩 스타일에 적응시키고, 다른 유용한 틀들과 완벽하게 통합할 수 있도록, 당신의 길을 열어준다는 것입니다. + +Pixi의 API는 실제로 Macromedia/Adobe Flash가 개척한 잘 적용되고 전투 테스트 된 정교한 API입니다. Old-skool Flash 개발자들은 이에 대해 편안함을 느낄 것 입니다. 다른 현재 sprite rendering framework는 CreateJS, Starling, Sparrow 및 Apple의 SpriteKit과 같은 API를 사용합니다. Pixi의 API의 강점은 그것이 범용 목적이라는 것입니다: 이것은 게임 엔진이 아닙니다. 이러한 사실은 여러분이 좋아하는 것을 만들 수 있는 완전한 표현의 자유를 제공하고, 여러분 자신의 맞춤형 게임 엔진을 포장하기 때문에 좋습니다. 이 튜토리얼 에서는 Pixi의 강력한 image rendering 기능과 scene graph를 결합하여 게임을 만드는 방법을 알아 봅니다. 그러나 Pixi는 단지 게임만을 위한 것이 아닙니다. 당신은 이와 같은 기술을 사용하여 모든 대화 형 미디어 응용 프로그램을 만들 수 있습니다. 즉, 휴대 전화 용 앱을 의미합니다! + +너가 이 튜토리얼을 시작하기 전에 무엇을 알아야 할까요? + +HTML과 JavaScript에 대해 충분히 이해하고 있어야 합니다. 당신은 전문가가 아니며, 열심히 배워야하는 야심 찬 초심자입니다. HTML과 JavaScript에 대해 잘 모르는 경우 이 책을 통해 학습을 시작하세요. + +[Foundation Game Design with HTML5 and JavaScript](http://www.apress.com/9781430247166) + +내가 이 책을 썼기에 이 책이 최고라고 자부합니다! + +또한 시작할 때 도움이 되는 좋은 인터넷 자원이 있습니다. + +[Khan Academy: Computer Programming](http://www.khanacademy.org/computing/cs) + +[Code Academy: JavaScript](http://www.codecademy.com/tracks/javascript) + +무엇이든 간에 당신의 학습 방식에 가장 적합한 책을 고르세요. +이해하셨나요? JavaScript 변수, 함수, 배열 및 객체가 무엇이며 어떻게 사용하는지 알고 있으신가요? [JSON data files](http://www.copterlabs.com/blog/json-what-it-is-how-it-works-how-to-use-it/)가 무엇인지 알고 계신가요? [Canvas Drawing API](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Drawing_graphics_with_canvas)를 사용해 보셨나요? + +Pixi를 사용하려면, 당신의 루트 프로젝트 디렉토리에서 웹 서버를 실행해야 합니다. 웹 서버가 무엇이며 프로젝트 폴더에서 웹 서버를 시작하는 방법을 아시나요? 가장 좋은 방법은 [node.js](http://nodejs.org)를 사용한 다음 사용하기 쉬운 [http-server](https://github.com/nodeapps/http-server)를 설치하는 것입니다. 그러나 그렇게 하고 싶다면 Unix 명령 행 작업에 익숙해 져야합니다. 당신은 [이 비디오](https://www.youtube.com/watch?feature=player_embedded&v=cX9ASUE3YAQ)에서 유닉스를 사용하는 법을 배울 수 있습니다. 이 비디오가 끝이 나면 [이 비디오](https://www.youtube.com/watch?v=INk0ATBbclc)를 따라 해보세요. 당신은 Unix 사용 방법을 배워야 합니다. 배우기까지 2 시간 밖에 걸리지 않으며 컴퓨터와 상호 작용할 수있는 정말 재미 있고 쉬운 방법입니다. + +그러나 명령 행을 사용하여 혼란스럽기를 원치 않는다면 몽구스 웹 서버를 사용해보세요: + +[Mongoose](http://cesanta.com/mongoose.shtml) + +또는 훌륭한 [Brackets text editor](http://brackets.io)를 사용하여 모든 코드를 작성하십시오. Brackets는 기본 작업 공간에서 번개 모양 버튼을 클릭하면 자동으로 웹 서버와 브라우저를 실행합니다. 이제 준비가 되었다고 생각한다면 계속 읽어보세요! + +(독자에게 요청합니다: 이것은 살아있는 문서입니다. 구체적인 세부사항에 대해 질문이 있거나 내용이 명확하게 설명되어야 하는 경우 이 GitHub 저장소에 **문제**를 생성하세요. 자세한 내용은 텍스트를 업데이트하세요.) + + +설정 방법 +--------- + +코드 작성을 시작하기 전에 프로젝트 폴더를 만들고 프로젝트의 root directory에서 웹 서버를 시작하세요. 웹 서버를 사용하지 않는다면 Pixi는 작동하지 않습니다. + + +다음으로 Pixi를 설치해야합니다. + + +### 픽시 설치 + +이 소개에 사용 된 버전은 **v4.5.5**이며 이 저장소의 `pixi` 폴더 또는 [Pixi's release page for v4.5.5](https://github.com/pixijs/pixi.js/releases/tag/v4.5.5).에서 `pixi.min.js` 파일을 찾을 수 있습니다. 또는 [Pixi's main release page](https://github.com/pixijs/pixi.js/releases).에서 최신 버전을 다운로드 할 수 있습니다. + +Pixi를 사용하려면 이 파일 하나만 있으면 됩니다. 저장소의 다른 모든 파일을 무시할 수 있습니다: **당신은 그것들이 필요 없을 것입니다.** + +다음으로 기본 HTML 페이지를 만들고 ` +``` + +다음은 Pixi를 연결하고 작동하는지 테스트 할 수 있는 기본 HTML 페이지입니다.(이것은 `pixi.min.js`가 `pixi`라고 불리는 하위 폴더에 있다고 가정합니다.): + +``` + + +
+ +