{"id":17230557,"url":"https://github.com/irishbruse/ldtkmonogame","last_synced_at":"2025-04-05T20:04:17.688Z","repository":{"id":37899235,"uuid":"332335787","full_name":"IrishBruse/LDtkMonogame","owner":"IrishBruse","description":"Monogame importer, renderer and code generator for LDtk Level editor","archived":false,"fork":false,"pushed_at":"2024-10-14T19:09:15.000Z","size":23818,"stargazers_count":96,"open_issues_count":0,"forks_count":21,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T19:06:43.035Z","etag":null,"topics":["dotnet","ldtk","level-editor","monogame","wiki"],"latest_commit_sha":null,"homepage":"http://ldtk.ethanconneely.com/","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/IrishBruse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-01-24T00:21:06.000Z","updated_at":"2025-03-24T14:00:22.000Z","dependencies_parsed_at":"2024-01-23T18:50:09.539Z","dependency_job_id":"0c0105aa-85bc-4da8-8550-d93b102991bf","html_url":"https://github.com/IrishBruse/LDtkMonogame","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IrishBruse%2FLDtkMonogame","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IrishBruse%2FLDtkMonogame/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IrishBruse%2FLDtkMonogame/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IrishBruse%2FLDtkMonogame/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IrishBruse","download_url":"https://codeload.github.com/IrishBruse/LDtkMonogame/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247393566,"owners_count":20931812,"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":["dotnet","ldtk","level-editor","monogame","wiki"],"created_at":"2024-10-15T04:53:27.810Z","updated_at":"2025-04-05T20:04:17.652Z","avatar_url":"https://github.com/IrishBruse.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/IrishBruse/LDtkMonogame/main/Icon.png\" height=\"128px\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://ldtk.io/go/discord\"\u003e\u003cimg src=\"https://img.shields.io/badge/Discord-LDtk-yellow\" alt=\"Discord Link\"\u003e\u003c/a\u003e \u0026nbsp;\n    \u003ca href=\"https://github.com/deepnight/ldtk\"\u003e\u003cimg src=\"https://img.shields.io/badge/LDtk-1.5.3-yellow\" alt=\"\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nLDtkMonogame is an level importer for the LDtk level editor\n\n# Getting Started\n\nThe easiest way to start using LDtkMonogame is to import it into the project using [NuGet package](https://www.nuget.org/packages/LDtkMonogame/).\n\n-   [LDtkMonogame](https://www.nuget.org/packages/LDtkMonogame/)\n-   [LDtkMonogame.ContentPipeline](https://www.nuget.org/packages/LDtkMonogame.ContentPipeline/)\n-   [LDtkMonogame.Codegen](https://www.nuget.org/packages/LDtkMonogame.Codegen/)\n\nMake sure to import the namespace at the top\n\n```cs\nusing LDtk;\n// Optional\nusing LDtk.Renderer;\n```\n\nLDtk.Renderer is a premade renderer for the levels, you can create your own if you have more specific needs\n[ExampleRenderer.cs](https://github.com/IrishBruse/LDtkMonogame/blob/main/LDtk/Renderer/ExampleRenderer.cs)\nis an example of how to make one. Or you can inherit it and extend it.\n\nTo get started loading ldtk files load the file in `Initialize`.\n\n```cs\nLDtkFile file = LDtkFile.FromFile(\"World\", Content);\nLDtkFile file = LDtkFile.FromFile(\"Data/World.ldtk\");\n```\n\nThen load the world right after for now ldtk only supports one file but make sure to enable the multiworlds flag in the project settings under advanced.\n\n```cs\nLDtkWorld world = file.LoadWorld(Worlds.World.Iid);\n```\n\nThe `Worlds.World.Iid` is generated from the ldtkgen tool and is recommended that you use it for static typing of entities and levels.  \nIt is a class within in a class that represents the world name and the levels name and holds the iid you can use to load that specific level.\n\nCreate the renderer in `Initialize`.\n\n```cs\nExampleRenderer renderer = new ExampleRenderer(spriteBatch, Content);\nExampleRenderer renderer = new ExampleRenderer(spriteBatch);\n```\n\nPrerender Levels\n\n```cs\nforeach (LDtkLevel level in world.Levels)\n{\n    renderer.PrerenderLevel(level);\n}\n```\n\nNow to render the level and entities we loaded in `Draw`\n\n```cs\nGraphicsDevice.Clear(world.BgColor);\n\nspriteBatch.Begin(samplerState: SamplerState.PointClamp);\n{\n    foreach (LDtkLevel level in world.Levels)\n    {\n        renderer.RenderPrerenderedLevel(level);\n    }\n}\nspriteBatch.End();\n```\n\n# Showcase\n\n## Unnamed\n\n![screenshot](https://raw.githubusercontent.com/IrishBruse/LDtkMonogame/main/docs/Unnamed.png)\n\n\u003e by Fypur\n\n[Play the game on Itch](https://fypur.itch.io/unnamed)\n\n## Example Game\n\n![screenshot](https://raw.githubusercontent.com/IrishBruse/LDtkMonogame/main/LDtk.Example/Screenshot.png)\n\n\u003e by IrishBruse\n\n[Source code here](./LDtk.Example/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firishbruse%2Fldtkmonogame","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Firishbruse%2Fldtkmonogame","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firishbruse%2Fldtkmonogame/lists"}