Skip to content

Commit 3395efb

Browse files
authored
Updated some typos, grammar fixes and added a credits section for the free tileset used in my example .gifs. (#245)
1 parent 5870bdf commit 3395efb

File tree

1 file changed

+15
-18
lines changed

1 file changed

+15
-18
lines changed

wiki/tools/tiled-map-packer.md

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,26 @@ title: "Tiled Map Packer"
44

55
# TiledMapPacker
66

7-
> **Warning**, while the latest TiledMapPacker is available for download.
8-
> In order to use maps created with it. You must be using the latest SNAPSHOT version of libGDX, currently *1.13.2-SNAPSHOT*.
7+
> **Warning:** While the latest TiledMapPacker is available for download, you must be
8+
> using the latest SNAPSHOT version of libGDX, currently 1.13.2-SNAPSHOT, to load maps created with it.
99
1010
You can download the runnable JAR release of **TiledMapPacker**, [here](https://libgdx-nightlies.s3.eu-central-1.amazonaws.com/libgdx-runnables/runnable-tiledmappacker.jar).
1111

12-
*Offline tool for processing one or more Tiled maps (`.tmx` or `.tmj`) into a single optimized `TextureAtlas`, combining tilesets,
13-
image layers, and individual images into an atlas for use with the `AtlasTmxMapLoader` or `AtlasTmjMapLoader`.*
14-
12+
*Offline tool for preparing Tiled maps (`.tmx` or `.tmj`) to use a single optimized `TextureAtlas` for rendering
13+
in libGDX, by combining tilesets, image layers, and individual images. Designed for use with `AtlasTmxMapLoader` or `AtlasTmjMapLoader`.*
1514

1615
## Why use TiledMapPacker?
1716

1817
TiledMapPacker is designed to optimize your Tiled maps for better runtime performance:
1918

20-
- **Fewer draw calls** – By combining multiple tilesets, images, and layers into a single optimized `TextureAtlas`,
21-
your game can render entire maps faster with fewer texture switches. This is especially helpful for parallax backgrounds made using imagelayers, and maps that use a variety of tilesets.
19+
- **Fewer draw calls** – By combining multiple tilesets, images, and layers into a single optimized `TextureAtlas`,
20+
your game can render entire maps faster with fewer texture switches. This is especially helpful for parallax backgrounds made using imagelayers, and maps that use a variety of tilesets.
2221
- **Optional tile stripping** – Unused tiles can be omitted to reduce file size and memory use.
2322

2423

2524
## Running TiledMapPacker
2625

27-
### Stand‑alone JAR
26+
### Standalone JAR
2827

2928
```
3029
# Creates an output directory named "output" next to INPUTDIR
@@ -33,16 +32,15 @@ java -jar runnable-tiledmappacker.jar ./maps
3332
# Explicit output directory
3433
java -jar runnable-tiledmappacker.jar ./maps ./maps-packed
3534
36-
# Explicit output directory, as well maps needing .tiled-project files to load
35+
# Explicit output directory, as well as loading maps that require .tiled-project files
3736
java -jar runnable-tiledmappacker.jar ./maps ./maps-packed ./customClass.tiled-project
3837
3938
# Various options are available as well such as verbose logging and stripping unused tiles
40-
java -jar runnable-tiledmappacker.jar ./maps ./maps-packed -v --strip-unused`
39+
java -jar runnable-tiledmappacker.jar ./maps ./maps-packed -v --strip-unused
4140
```
4241

4342
> **Note:** TiledMapPacker internally uses `TmxMapLoader` and `TmjMapLoader`, which require a valid OpenGL context. The runnable JAR automatically creates a minimal LwjglApplication that opens a small window.
4443
45-
4644
## Positional arguments
4745

4846
| Argument | Description |
@@ -64,7 +62,7 @@ java -jar runnable-tiledmappacker.jar ./maps ./maps-packed -v --strip-unused`
6462
## Default Per‑Map Atlases vs Combined
6563

6664
- **Per‑map** (default) – Each individual map gets its own atlas.
67-
65+
6866
*Command*: `java -jar tiledmappacker.jar ./maps`.
6967

7068
- **Combined** – All tilesets across every map are packed into a single giant
@@ -89,7 +87,6 @@ java -jar runnable-tiledmappacker.jar ./maps ./maps-packed -v --strip-unused`
8987
assetManager.load("maps/testLevel.tmx", TiledMap.class);
9088
```
9189

92-
9390
## Handling ImageLayers
9491

9592
Image‑layers are detected automatically. Each image is renamed to a safe region
@@ -110,8 +107,8 @@ is rewritten. The modified atlas map loaders resolve these names automatically.
110107

111108
## Results
112109

113-
In a worse case scenario we have below a map created with 3 different tilesets, one of those tilesets being a
114-
"collection-of-images". As well as 8 image layers being used to for parallax background effects.
110+
In a worst-case scenario, we have a map that uses three different tilesets,
111+
including a "collection-of-images" tileset, along with eight image layers for parallax background effects.
115112

116113
![TiledMap UI Layers](/assets/wiki/images/tiledmappacker1.png)
117114

@@ -120,14 +117,14 @@ In the below example we range 12 to 14 depending on where we are on the screen.
120117

121118
![Unoptimized TMX Map](/assets/wiki/images/tiledmappacker2.gif)
122119

123-
But choosing to use the TiledMapPacker and an `AtlasTmxMapLoader`. We can significantly reduce our draw calls.
120+
But by using the TiledMapPacker and an AtlasTmxMapLoader, we can significantly reduce our draw calls.
124121
In this case, down to 1.
125122

126123
![Optimized Atlas TMX Map](/assets/wiki/images/tiledmappacker3.gif)
127124

128-
129-
130125
## Example Tests
131126
* [Running TiledMapPacker](https://github.com/libgdx/libgdx/blob/master/extensions/gdx-tools/src/com/badlogic/gdx/tiledmappacker/TiledMapPackerTest.java)
132127
* [Rendering Packed Atlas Tiled Maps](https://github.com/libgdx/libgdx/blob/master/extensions/gdx-tools/src/com/badlogic/gdx/tiledmappacker/TiledMapPackerTestRender.java)
133128

129+
## Asset Credits
130+
* Example .gifs use free assets from the [**SunnyLand Tileset**](https://ansimuz.itch.io/sunny-land-pixel-game-art).

0 commit comments

Comments
 (0)