2015년 6월 20일 토요일

corona sdk 에서 tiled 사용하기 01 – Using Layers to Create Depth

corona sdk에서 타일 사용하는 두번째 예제입니다. 번역아닙니다.

https://github.com/anthonymoralez/lime-tutorials/tree/master/tutorial-01

http://lime.outlawgametools.com/tutorials/01-using-layers-to-create-depth/

01 – Using Layers to Create Depth

(Depth를 생성해 Layer를 사용하기)


Posted by admin - December 30, 2012 - Tutorials
0
layers

Difficulty: Beginner

Duration: 10 minutes 10분정도 걸린다네요

Description:

In the previous tutorial we created a simple map which worked fine for our needs and looked great on screen yet underneath the hood there is a problem; every Corona display object is on the save level which can cause problems when playing a game because you want your player to be able to go behind certain things and in front of others. Don’t worry though as the solution to this is simple.

Step 1: Load your map into Tiled (당신타일을 tiled에 로드 하셈)

Firstly start up Tiled and File >> Open to load up the map we created in the previous tutorial.
이전 예제로 사용한 타일 파일을 tiled 프로그램을 실행해서 open하세요

Step 2: Add a new layer (새로운 레이어를 추가하셈)

At first you will only have one layer in your map, this is what all your tiles have been added to so far. You can view this in the Layer panel to the right of Tiled:
당신 맵에 레이어가 하나밖에 없을껍니다.(오른쪽 레이어 창 확인시)
Layer Panel
Having just one layer is easy to manage but you will find that when your maps get more complicated it can get harder to deal with all the layers, luckily you can hide them by unticking them or change their opacity using the slider provided, please note though that these have no affect on your levels within Corona itself.
To add a new layer just right-click on the Layer panel and select Add Tile Layer…, object layers will be explained in a later tutorial. You will notice that you now have a new layer created and selected called “Tile Layer 2″ that is currently above the first one. The higher the layer is in the list the higher its z-depth will be in Corona.
새로운 레이어를 추가하려면 layer 윈도우에서 오른쪽 클릭 하고 add tile layer를 선택하면 됩니다. 레이어 순서가 있습니다. z-order 방식으로 위에 있는 레이어가 위쪽 레이어입니다.

New Layer

Step 3: Add some tiles to the layer(레이어에 타일들을 넣으세요)

With your new layer created adding tiles is as simple as it was before, just make sure it is selected in the Layers panel and then start drawing your tiles.
Try adding some tiles with transparency to a position that has a tile on the first layer, such as this:
새로운 레이어를 추가하고 투과성 있는 블럭을 놓으면 아래와 같이 layer가 투과되어 나타납니다.

Correct Layer
Notice that the tiles are placed nicely on top of the previous tiles without intefering with them. If you had added the new tiles to the first layer it would have looked like this:
타일을 상위 레이어에 놓지 않고 Layer1 에 놓았으면 아래와 같이 나올것입니다.
Wrong Layer

Step 4: Run your new map(새로운맵으로 실행해보세요)

Now everything is completed just load up the map in Corona as before and you’ll notice that the layering order has been preserved. Feel free to reorder your layers in Tiled to see what the differences are.
지금까지 제대로 했으면 아래와 같이 나오는데 ㅎㅎ 자유롭게 레이어 테스트 해보셈ㅋㅋ
이번시간에는 특별한거 없네요.
Complete



꼭 알아두세요.
1. lime은 프로젝트 최상위 폴더에 lime폴더 통째로 복사해서 넣습니다.
2. Layer는 높은쪽이 위쪽 레이어입니다.

댓글 없음:

댓글 쓰기