How to Implement TileMap in LibGdx?

May 1, 2013 | Rishabh Agrawal | General

Step 1: Download TileMap Editor http://www.mapeditor.org

Step 2: Creating the game map

             Start up TileMap editor and choose “New map” in file menu. Enter a map size i.e screen size.

             I am using 32 x 32 (480 x 480) and tile size 16 X 16.

              Now choose “New Tileset” option in map menu.

Step 3: Now draw the map. TileMap editor works just like a pixel image editor .Save file with .tmx extension.(examle: level1.tmx)

Step 4: copy the .tmx file and tileset png in your assets/data folder ?

Step 5: just add code in create()

map* = new TmxMapLoader().load("data/level1.tmx");
renderer* = new OrthogonalTiledMapRenderer(map, 1 / 16f);

* TiledMap map;
* OrthogonalTiledMapRenderer renderer;



and render it on render() method

renderer.setView(camera);
renderer.render();

 

Post By:- Neha Agrawal


THE AUTHORRishabh Agrawal

Rishabh Agrawal is the founder of Creatiosoft, a company focused on creating high-quality software for the iGaming industry, specialising in poker and card games. With years of experience, Rishabh is dedicated to delivering engaging and user-friendly gaming experiences. Through this blog, he shares his passion and insights to help readers understand the latest trends and advancements in iGaming.

Comments are closed.

Recent Posts

The Future of Mobile Gaming: What to Expect in the Next 5 Years

Over the years, mobile gaming has seen amazing development and innovation utilized by the game development company in India. It…
06 Jun 2023 Rishabh Agrawal

How Do I Get Started With NFT Gaming?

The popularity of the NFT game has created a different fan base. There was a time when games were a…
18 Jul 2022 Rishabh Agrawal

What Are The Top Trends in NFT Marketplace 2022?

The NFTs are the new engaging and revolutionary technology across the globe. Though, these non-fungible tokens appeared for the first…
09 Jun 2022 Rishabh Agrawal