2015년 6월 20일 토요일

corona sdk 에서 tiled 사용하기 04 – More Info on Tilesets




NOTE: This tutorial is copied from the original at OutlawGameTools.com

04 – More Info on Tilesets (타일셋에서 좀 더 많은 정보)

Difficulty: Beginner 초보자가
Duration: 10 minutes 10분만 하면 된다.
Description:
Tilesets are obviously an important part of Tiled and Lime, in this tutorial we will show just how easy it is to work with them and reuse them in multiple maps.

Step 1: Add your second tileset (두번째 타일셋을 추가해보자)

Load up your map into Tiled just as before and go about adding another tileset just like you added the first one.
Tiled에서 이전 맵을 로드하고 이전에 했던것처럼 다른 타일셋을 추가 해보세요. (Map >> New Tileset)
I have uploaded another tileset image that you can use here.
링크에 새로운 타일셋을 올려두었습니다.
TileSet Ice

Step 2: Draw your new tiles (새로운 타일 그리기)

With your new tileset added you can now add new tiles from it just like the first one, try mixing stuff up to make things interesting. It looks pretty cold up in those clouds.
새로운 타일을 추가했으니 그걸 이용해서 섞어서 그리면 됩니다.
New Tiles

Step 3: Exporting out your tileset (당신의 타일셋을 내보내기)

Imagine the situation; you’ve created a fantastic level that reaches the awesome heights of World 1-1, you’ve added loads of properties to your tiles and you are feeling really happy with your masterpiece. So happy in fact that you want to make a second level using the same tileset.
Do you recreate the tileset and all its properties in a second map file? Time consuming. What happens if you need to change a property in both tilesets? Frustrating. The solution? Simple.
하나의 레벨을 만들었으면 새로운 레벨용 tmx를 파일을 만드는데, 이때 new tilesets를 로딩하게 프로퍼티 설정이 없기 때문에 다시 설정해야하는 문제가 생깁니다. 따라서 이때 external tilesets를 사용하게 됩니다.

External tilesets.(외부 타일셋들)

By exporting your tilesets out to .tsx files you are able to reuse them in as many levels as you like and any required changes only need to be done once.
To export your tileset simply right click it and select Export Tileset As... and select a suitable name. Your map is now using the external version. Or on the toolbar at the bottom of the Tileset pane click the document with right-arrow icon.
export하려면 타일셋 윈도우 아래쪽에 보면 조그만한 아이콘이 있는데 이중에 마우스를 가져가면 Export tileset As 라는 항목이 있습니다.
If you need to change any values just right click it again and select Import Tileset and change away, remembering to export it out again once you have finished so all your maps get the desired changes.
만약 타일셋의 값을 변경하려면 import한뒤 변경해줘야 합니다.
To add an external tileset to a new map simply select Map >> Add External Tileset... and browse for your .tsx file.
추가하려면 Map >> Add External Tileset. 이 메뉴를 사용하면 됩니다.
lime에서 사용하려면 export된 상태에서 사용해야 합니다. 이말이 무슨 의미인가하면 tmx 파일을 열어보면 png파일은 지원하나 export되면  <tileset firstgid="1" source="img/tileset-platformer.tsx"/> 이런식으로 나오는데 lime에서 tsx 파일을 못불러 오는 문제가 있기 때문에 import 상태를 유지해야 합니다.(property를 변경가능한 상태)
Resources:
Completed Project: git clone https://github.com/anthonymoralez/lime-tutorials
Tileset: Download

이번강좌는 tileset 추가에 대한 내용입니다.


꼭 알아두세요.
1. lime은 프로젝트 최상위 폴더에 lime폴더 통째로 복사해서 넣습니다.
2. Layer는 높은쪽이 위쪽 레이어입니다.
3. Tiled에서 tileset의 프로퍼티는 이름과 값으로 구성됩니다.
4. 화면에 보이게한뒤 물리 설정을 해야합니다. local visual = lime.createVisual(map) => local physical = lime.buildPhysical(map)
5. 타일셋에 물리 객체는 HasBody로 합니다.
6. 타일셋 import/export로 현재 저장된 프로퍼티를 다른 맵파일(tmx)과 쉽게 공유할 수 있습니다.

댓글 없음:

댓글 쓰기