{"id":13663096,"url":"https://github.com/jordansirwin/2DPlatformerMapGenerator","last_synced_at":"2025-04-25T13:31:32.634Z","repository":{"id":82172360,"uuid":"123844283","full_name":"jordansirwin/2DPlatformerMapGenerator","owner":"jordansirwin","description":"Generates 2D Platformer style maps using an image as the source","archived":false,"fork":false,"pushed_at":"2018-03-07T08:53:54.000Z","size":100,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T07:22:45.696Z","etag":null,"topics":["unity","unity-asset","unity2d"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jordansirwin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-03-05T00:50:25.000Z","updated_at":"2023-12-19T12:09:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"9577ebc6-3a87-4fa7-83d5-4fc820e24189","html_url":"https://github.com/jordansirwin/2DPlatformerMapGenerator","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/jordansirwin%2F2DPlatformerMapGenerator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordansirwin%2F2DPlatformerMapGenerator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordansirwin%2F2DPlatformerMapGenerator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordansirwin%2F2DPlatformerMapGenerator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jordansirwin","download_url":"https://codeload.github.com/jordansirwin/2DPlatformerMapGenerator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250824949,"owners_count":21493369,"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":["unity","unity-asset","unity2d"],"created_at":"2024-08-02T05:02:17.536Z","updated_at":"2025-04-25T13:31:29.902Z","avatar_url":"https://github.com/jordansirwin.png","language":"C#","funding_links":[],"categories":["C\\#"],"sub_categories":[],"readme":"# 2D Platformer Map Generator\n\nCreates a 2D Platformer style map by generating tiles for each pixel on a texture.\n\n\n## Quick Start\n\nImport the package into your Unity project to get a preconfigured Scene with an example map and tiles ready to go. All assets for this package will be imported into a folder called \"2DPlatformerMapGenerator\".\n\nOnce imported, load the scene \"2DPlatformerMapGeneratorExample\" and hit play. You'll see an example map load using the included \"map01.png\" texture and various included tiles.\n\n\n## Details\n\nYou really only need the following scripts to use this package:\n\n* MapGenerator.cs\n* TileInfo.cs\n\nAttach MapGenerator to a GameObject in the scene, then configure it as neccessary:\n\n**Parent Object**\n\nAll of the generated map tiles will be added to the scene as a child of this object.\n\n**Color Match Threshold**\n\nI found reading pixels from textures to not always be 100% accurate due to occassional rounding errors in the float conversion. Since each tile will be rendered based on a pixel color match, I introduced this threshold to allow for minor variation in colors to still match. Typically, setting this to a low value such as **0.01f** is more than enough to compesate. If you want 100% match requirements, simply set this value to **0**.\n\n**Ignore Pixel Alpha Threshold**\n\nAny pixels with an alpha setting equal or below this value will be ignored. \n\n**Tile Layer**\n\nThe layer to add all generated tiles too.\n\n**Missing Tile Prefab**\n\nIf a pixel is assigned to a tile, but the prefab is null (unassigned), this prefab will be used instead. Typically I set this to a hot pink colored asset so it's obvious in the scene.\n\n**Tile Info**\n\nThis array maps pixel colors to a tile to render. Each element has the following attributes:\n\n*Pixel Color*: When this pixel color is found the the map, it will render the corresponding tile.\n*Tile Prefab*: The tile to render when the pixel color is matched.\n\n**Map To Generate**\n\nThe texture representing the map you want to generate tiles for. Every pixel will be scanned and compared for a Tile Info mapping (or skipped if within the Alpha Threshold) and a GameObject will be instantiated based on the assigned tile prefab.\n\nWhen importing an image for the map be sure to set the following attributes on the texture:\n\n* Filter Mode: Point (no filter)\n* Compression: None\n* Read/Write Enabled: True\n\n\n## Editor Options\n\nWhen in the Editor, there is a custom Menu called \"2DPlatformerMapGenerator\" with two options:\n\n**Generate Map**\n\nWill generate the map so you can see it during editing the scene.\n\n**Clear Map**\n\nWill clear all of the generated map tiles. It is IMPORTANT to do this, otherwise they'll become permanant members of your scene :D\n\n\n## Attributions\n\nThe sprites used for tiles are from the **Platformer Art Deluxe** pack on **OpenGameArt.Org**:\nhttps://opengameart.org/content/platformer-art-deluxe\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjordansirwin%2F2DPlatformerMapGenerator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjordansirwin%2F2DPlatformerMapGenerator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjordansirwin%2F2DPlatformerMapGenerator/lists"}