summaryrefslogtreecommitdiff
path: root/readme.md
blob: 0eacb82188aa0490ef38b8b2acca0806d90cacb4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# fast_tiled

Parser for the tmx format Version 1.5

## Goals

- fast parsing of tiled files
- a low level (to parse single files)
- a higher level API (point to a map and it loads all tile-maps it references, or loads an entire world from a world file and stuff like that)

## The plan

The idea is to first have something low level that just parses the tmx/tsx files and provides them in rust types.

After that is done there could be more high level methods/struct that provide more high level functionality.

Wishlist (things that would be nice):

- serializing from rust types back to tmx/tsx (this needs including another xml lib, because roxmltree if fast because it is read-only)
- parsing from and serializing back to the tiled JSON based formats

## Thanks to

- https://docs.rs/tmx/0.3.1/ - Inspiration for data types.

## Notes:

Move: version="1.4" tiledversion="1.4.3" to some kind of file-wrapper type? Because it is also present in tilesets? Or just add those two to tileset and inherit it if its inline/embedded.


## progress

| element              | rust representation | parse from XML | tests for parse |
| -------------------- | ------------------- | -------------- | --------------- |
| `<map>`              | partial             | -              | -               |
| `<editorsettings>`   | -                   | -              | -               |
| `.<chunksize>`       | -                   | -              | -               |
| `.<export>`          | -                   | -              | -               |
| `<tileset>`          | partial             | -              | -               |
| `.<tileoffset>`      | complete            | complete       | complete        |
| `.<grid>`            | complete            | complete       | complete        |
| `.<image>`           | partial             | -              | -               |
| `.<terraintypes>`    | complete            | -              | -               |
| `..<terrain>`        | complete            | complete       | -               |
| `.<transformations>` | complete            | complete       | complete        |
| `.<tile>`            | partial             | -              | -               |
| `..<animation>`      | complete            | -              | -               |
| `.<frame>`           | complete            | -              | -               |
| `.<wangsets>`        | partial             | -              | -               |
| `..<wangset>`        | partial             | -              | -               |
| `...<wangcolor>`     | complete            | -              | -               |
| `...<wangtile>`      | partial             | -              | -               |
| `....Wang ID`        | -                   | -              | -               |
| `<layer>`            | -                   | -              | -               |
| `.<data>`            | -                   | -              | -               |
| `.<chunk>`           | -                   | -              | -               |
| `.<tile>`            | -                   | -              | -               |
| `<objectgroup>`      | -                   | -              | -               |
| `.<object>`          | -                   | -              | -               |
| `.<ellipse>`         | -                   | -              | -               |
| `.<point>`           | -                   | -              | -               |
| `.<polygon>`         | -                   | -              | -               |
| `.<polyline>`        | -                   | -              | -               |
| `.<text>`            | -                   | -              | -               |
| `<imagelayer>`       | -                   | -              | -               |
| `<group>`            | -                   | -              | -               |
| `<properties>`       | complete            | yes            | yes             |
| `.<property>`        | complete            | yes            | yes             |
| `<template>`         | -                   | -              | -               |