Tiled地圖編輯器(二)功能點

來源:互聯網
上載者:User

Title地圖編輯器功能強大、靈活,我認為能實現《坦克大戰》遊戲的的地圖需求。 Title地圖編輯器的實現

Title地表編輯器其產生的資料檔案為xml格式。其思想為:一個地圖由多個層次的圖層構成,

分為映像層、塊層和對象層,這些層的層次關係可以按序指定。

其實現的功能點有:

1.      建立地圖。

2.      編輯物體。

3.      編輯地圖塊。

4.  編輯映像層。

5.  編輯塊層。

6.  編輯對象層。

  1. 建立地圖

l   指定x,y方向上地圖塊個數

l   指定地圖塊的大小。

 

XML檔案節點內容為

<map version="1.0" orientation="isometric" width="27" height="27" tilewidth="64" tileheight="32">

<layer name="塊層1" width="27" height="27">

<data>

<tile gid="0"/>

<tile gid="0"/>

…

<tile gid="0"/>

</data>

</layer>

</map>

  2. 編輯物體

l  物體名稱

l  物體映像資源

l  物體相對於地表塊的位移位置

l  物體的屬性編輯

如下編輯了物體的一些屬性:“名稱”、“多幀圖”等等。

XML檔案節點內容為

<tileset firstgid="1" name="perspective_walls" tilewidth="64" tileheight="64">

<image source="D:/坦克大決戰/地圖/perspective_walls.png" width="256" height="256"/>

<tileoffset x="10" y="10"/>

<tile id="0">

<properties>

<property name="名稱" value="房子"/>

<property name="多幀圖" value="house-1.xmp"/>

<property name="效果圖" value="起煙.xmp"/>

<property name="效果圖的位移位置" value="4;20"/>

<property name="陰影圖" value="shadow-1.xmp"/>

<property name="陰影圖的位移位置" value="10;20"/>

</properties>

</tile>

</tileset>

  3. 編輯地圖塊

l  地圖塊名稱

l  地圖塊映像資源

l  地圖塊的屬性編輯

XML檔案節點內容為:

<tileset firstgid="1" name="地圖塊資訊" tilewidth="64" tileheight="64">

<image source="D:/坦克大決戰/地圖/perspective_walls.png" width="256" height="256"/>

<properties>

<property name="碰撞" value="false"/>

</properties>

</tile>

</tileset>

注意:地圖塊在程式中不繪製,只是在地圖編輯器中顯示,用來指定某個地表塊。

 

  4.映像層

l  可添加/刪除多個映像層

l  設定在操作視圖中是否可見

l  顯示設定圖層的背景映像

 

 

XML檔案節點內容為:

 <imagelayer name="映像圖層1" width="27" height="27">

<image source="D:/坦克大決戰/地圖/1-small.jpg"/>

</imagelayer>

  5.塊層

 

l  可添加/刪除多個塊層

l  設定在操作視圖中是否可見

l  在塊層上放置/刪除物體

l  若物體由多個子組件組合,可以框選住多個物體,同時放入到情境中

 

 

 

XML檔案節點內容為:

<layer name="塊層1" width="27" height="27">

<data>

<tile gid="1"/>

<tile gid="2"/>

<tile gid="0"/>

…

</data>

</layer>

  6.對象層

l 在對象層上添加/刪除某個物體執行個體

l 編輯該物體的屬性

l 設定在操作視圖中是否可見

l 操作簡單:ctrl+c,ctrl+v即可複製某個物體

 

XML檔案節點內容為:

 <objectgroup name="對象層1" width="27" height="27">

<object name="hous1" gid="1" x="32" y="32">

<properties>

<property name="name" value="1"/>

</properties>

</object>

<object gid="1" x="64" y="64"/>

</objectgroup>  

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.