{"id":13569732,"url":"https://github.com/SolarLune/ldtkgo","last_synced_at":"2025-04-04T06:31:12.294Z","repository":{"id":40572878,"uuid":"319748360","full_name":"SolarLune/ldtkgo","owner":"SolarLune","description":"LDtk-Go is a loader for LDtk projects written in Golang.","archived":false,"fork":false,"pushed_at":"2024-08-21T15:23:15.000Z","size":108,"stargazers_count":99,"open_issues_count":3,"forks_count":15,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-29T02:07:56.536Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/SolarLune.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","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":"2020-12-08T20:05:54.000Z","updated_at":"2025-03-07T05:40:05.000Z","dependencies_parsed_at":"2024-05-06T15:53:49.821Z","dependency_job_id":"f4d1bb83-ddd9-456c-b332-e90f56b1a8df","html_url":"https://github.com/SolarLune/ldtkgo","commit_stats":{"total_commits":21,"total_committers":2,"mean_commits":10.5,"dds":0.09523809523809523,"last_synced_commit":"fac4c85d260a9d71d5b0540bbf311deb9215b486"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SolarLune%2Fldtkgo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SolarLune%2Fldtkgo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SolarLune%2Fldtkgo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SolarLune%2Fldtkgo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SolarLune","download_url":"https://codeload.github.com/SolarLune/ldtkgo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247134403,"owners_count":20889396,"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":[],"created_at":"2024-08-01T14:00:43.443Z","updated_at":"2025-04-04T06:31:11.904Z","avatar_url":"https://github.com/SolarLune.png","language":"Go","readme":"# LDtk-Go\n\nLDtk-Go is a loader for [LDtk v0.9.3](https://ldtk.io/) projects written in pure Go.\n\n![Screenshot](https://i.imgur.com/fFDmCCw.png)\n\nGenerally, you first load a project using `ldtkgo.Open()` or `ldtkgo.Read()`; afterward, you render the layers out to images, and then draw them onscreen with a rendering or game development framework, like [ebiten](https://hajimehoshi.github.io/ebiten/), [Pixel](https://github.com/faiface/pixel), [raylib-go](https://github.com/gen2brain/raylib-go), or [raylib-go-plus](https://github.com/Lachee/raylib-goplus). An example that uses ebiten for rendering is included.\n\nAll of the major elements of LDtk should be supported, including Levels, Layers, Tiles, AutoLayers, IntGrids, Entities, and Properties.\n\n[Pkg.go.dev docs](https://pkg.go.dev/github.com/solarlune/ldtkgo)\n\n## Loading Projects\n\nUsing LDtk-Go is simple. \n\nFirst, you load the LDTK project, either with `ldtkgo.Open()` or `ldtkgo.Read()`. After that, you have access to most of the useful parts of the entire LDTK project. You can then render the map using the included renderer if you're using [Ebitengine](https://ebitengine.org/).\n\n```go\npackage main\n\nimport (\n\t\"embed\"\n\n\t\"github.com/solarlune/ldtkgo\"\n\trenderer \"github.com/solarlune/ldtkgo/renderer/ebitengine\"\n)\n\nvar ldtkProject *ldtkgo.Project\nvar ebitenRenderer *renderer.Renderer\n\n//go:embed *.ldtk *.png\nvar fileSystem embed.FS\n\nfunc main() {\n\t// Load the LDtk Project\n\tldtkProject, err := ldtkgo.Open(\"example.ldtk\", fileSystem)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// ldtkProject now contains all data from the file.\n\t// If you'd like to render it, you could use the included renderer that uses Ebitengine:\n\n\t// Choose a level...\n\tlevel := ldtkProject.Levels[0]\n\n\t// Create a new renderer...\n\tebitenRenderer = renderer.New(ldtkProject)\n\n\t// ... And render the tiles for the level out to layers, which will be *ebiten.Images. We can then retrieve them to draw in a Draw() loop later.\n\tebitenRenderer.Render(level)\n}\n\n\n```\n\n## Running the Example\n\n`cd` to the example directory, and then call `go run .` to run the example (as it's self-contained within its directory). The console will give instructions for interacting with the example.\n\n## Anything Else?\n\nThe core LDtk loader requires the `encoding/json` and `image` package. The Ebiten renderer requires Ebitengine as well, of course.\n\n## To-do\n\n- [ ] Add map clipping / viewports to Ebitengine renderer","funding_links":[],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSolarLune%2Fldtkgo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSolarLune%2Fldtkgo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSolarLune%2Fldtkgo/lists"}