{"id":23191934,"url":"https://github.com/markwinter/tmxjson","last_synced_at":"2025-04-05T06:44:50.152Z","repository":{"id":71641265,"uuid":"121617265","full_name":"markwinter/tmxjson","owner":"markwinter","description":"C++14 Library for reading json formatted Tiled maps","archived":false,"fork":false,"pushed_at":"2018-08-19T13:52:52.000Z","size":223,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-10T14:42:46.079Z","etag":null,"topics":["tiled-map-editor"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/markwinter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-15T10:37:35.000Z","updated_at":"2018-08-19T13:52:53.000Z","dependencies_parsed_at":"2023-02-22T00:45:23.459Z","dependency_job_id":null,"html_url":"https://github.com/markwinter/tmxjson","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markwinter%2Ftmxjson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markwinter%2Ftmxjson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markwinter%2Ftmxjson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markwinter%2Ftmxjson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markwinter","download_url":"https://codeload.github.com/markwinter/tmxjson/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247299786,"owners_count":20916186,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["tiled-map-editor"],"created_at":"2024-12-18T12:19:27.882Z","updated_at":"2025-04-05T06:44:50.146Z","avatar_url":"https://github.com/markwinter.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tmxjson\n\ntmxjson is a library for reading json formatted maps exported from the [Tiled Map Editor](http://www.mapeditor.org/).\n\nSupported Tiled version: 1.1\n\n### Using Tiled and tmxjson\n- Available formats: `CSV` `Base64 (Uncompressed)` `Base64 (zlib compressed)`\n- You must also embed your tilesets into the map.\n- Export your map as json to be used by this library (File \u003e Export As)\n\n### How to use this library\nYou can either include the source in your project, or you can build it and link against it.\n\nThen you will want to use an instance of the Map class to load and render your map.\n\n```CPP\n#include \u003cMap.hpp\u003e\n\ntmxjson::Map map(\"mymap.json\");\nauto layers = map.GetLayers();\nauto tile_sets = map.GetTileSets();\n\nfor (const auto\u0026 layer : layers)\n  ParseLayer(layer);\n\nvoid ParseLayer(tmxjson::Layer\u0026 layer) {\n  if (layer.GetType() == tmxjson::LayerType::kGroup) {\n    // Groups contain more embedded layers\n    for (const auto\u0026 child_layer : layer.GetLayers())\n      ParseLayer(child_layer);\n  } else if (layer.GetType() == tmxjson::LayerType::kTileLayer) {\n    for (const auto\u0026 tile : layer.GetData()) {\n      ... // Render your tiles\n    }\n  } else if (layer.GetType() == tmxjson::LayerType::kObjectGroup) {\n    for (const auto\u0026 object : layer.GetObjects()) {\n      ... // Render your objects\n    }\n  } else if (layer.GetType() == tmxjson::LayerType::kImageLayer) {\n    ... // Render your image\n  }\n}\n```\n\n### Working with custom properties\n\nYou must cast to `tmxjson::TypedProperty\u003cTYPE\u003e` in order to use the method `GetValue()`\n\n```CPP\nfor (auto property : map.GetProperties()) {\n  if (property-\u003eGetType() == tmxjson::PropertyType::kString)\n    std::cout \u003c\u003c \"Property (\" \u003c\u003c property-\u003eGetName() \u003c\u003c \"): \" \u003c\u003c\n      dynamic_cast\u003ctmxjson::TypedProperty\u003cstd::string\u003e*\u003e(property.get())-\u003eGetValue() \u003c\u003c std::endl;\n}\n```\n\n### Currently Not Supported\n- Tilesets: `terrains`, `tiles`\n- Wang sets\n\n### Current work\n- Finish implementing tmx 1.1 spec\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkwinter%2Ftmxjson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkwinter%2Ftmxjson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkwinter%2Ftmxjson/lists"}