{"id":13569790,"url":"https://github.com/anaseto/gruid","last_synced_at":"2025-04-04T06:31:15.375Z","repository":{"id":45905381,"uuid":"324167274","full_name":"anaseto/gruid","owner":"anaseto","description":"Cross-platform grid-based UI and game framework.","archived":true,"fork":false,"pushed_at":"2023-08-23T08:42:04.000Z","size":556,"stargazers_count":82,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-05T02:35:54.703Z","etag":null,"topics":["elm-architecture","go","golang","gruid","pathfinding","roguelikedev","ui"],"latest_commit_sha":null,"homepage":"https://codeberg.org/anaseto/gruid","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anaseto.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2020-12-24T13:53:24.000Z","updated_at":"2024-05-23T03:16:25.000Z","dependencies_parsed_at":"2024-01-14T03:47:45.010Z","dependency_job_id":"fc9a33d3-c3de-4c85-834e-4af0f3a518bf","html_url":"https://github.com/anaseto/gruid","commit_stats":null,"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anaseto%2Fgruid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anaseto%2Fgruid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anaseto%2Fgruid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anaseto%2Fgruid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anaseto","download_url":"https://codeload.github.com/anaseto/gruid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247134405,"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":["elm-architecture","go","golang","gruid","pathfinding","roguelikedev","ui"],"created_at":"2024-08-01T14:00:44.306Z","updated_at":"2025-04-04T06:31:14.925Z","avatar_url":"https://github.com/anaseto.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"**Migrated to https://codeberg.org/anaseto/gruid because of new 2FA requirement (you'll need to update your imports)**\n\n# Gruid\n\n[![pkg.go.dev](https://pkg.go.dev/badge/github.com/anaseto/gruid.svg)](https://pkg.go.dev/github.com/anaseto/gruid)\n[![godocs.io](https://godocs.io/github.com/anaseto/gruid?status.svg)](https://godocs.io/github.com/anaseto/gruid)\n\nThe **gruid** *module* provides packages for easily building grid-based\napplications in Go.  The library abstracts rendering and input for different\nplatforms. There are drivers available for terminal apps\n([gruid-tcell](https://github.com/anaseto/gruid-tcell)), native graphical apps\n([gruid-sdl](https://github.com/anaseto/gruid-sdl)) and browser apps\n([gruid-js](https://github.com/anaseto/gruid-js)). The original application for\nthe library was creating grid-based games, but it's also well-suited for any\ngrid-based application.\n\nThe core **gruid** *package* uses a convenient and flexible architecture of\nupdating a model in response to messages strongly inspired from the\n[bubbletea](https://github.com/charmbracelet/bubbletea) module for building\nterminal apps, which in turn is based on the functional [Elm\nArchitecture](https://guide.elm-lang.org/architecture/). The architecture has\nbeen adapted to be more idiomatic in Go in the context of grid-based\napplications: less functional and more efficient.\n\nYou can find examples below in the [Examples](#examples) section.\n\n# Overview of packages\n\nThe full documentation is linked at the top of this README. We provide here a\nquick overview.\n\nThe **gruid** package defines the Model and Driver interfaces and allows to\nstart the “update on message then draw” main loop of an application. It also\ndefines a convenient and efficient slice grid structure to represent the\nlogical contents of the screen and manipulate them.\n\nThe **ui** package defines common UI widgets and utilities: menu/table widget,\npager, text input, label, styled text drawing facilities and replay\nfunctionality.\n\nThe **tiles** package contains helpers for drawing fonts on images, which can\nbe used to manage character tiles using a Driver from either gruid-sdl or\ngruid-js.\n\nThe **paths** package provides efficient implementations of some common\npathfinding algorithms that are often used in grid-based games, such as\nroguelikes. You will find implementations of the A\\* and\n[JPS](https://en.wikipedia.org/wiki/Jump_point_search) algorithms, as well as\nDijkstra, breadth first, and connected components maps computations. See\n`move.go` in the movement example in\n[gruid-examples](https://github.com/anaseto/gruid-examples) for an annotated\nexample using JPS and the mouse.\n\nThe **rl** package provides some additional utilities commonly needed in\ngrid-based games such as roguelikes. The package provides an event priority\nqueue, two complementary field of view algorithms, map generation algorithms,\nas well as vault parsing and manipulation utilities.\n\n# Drivers\n\nThe **tcell**, **sdl**, and **js** packages in the\n([gruid-tcell](https://github.com/anaseto/gruid-tcell)),\n([gruid-sdl](https://github.com/anaseto/gruid-sdl)) and\n([gruid-js](https://github.com/anaseto/gruid-js)) modules provide specific\nrendering and input implementations satisfying gruid's package Driver\ninterface. The provided terminal driver only handles full-window applications.\nSee the README.md files in the respective repositories for specific build and\ndeployment instructions (gruid-sdl will require SDL2, and gruid-js will require\na bit of HTML and js).\n\n# Examples\n\nThe [gruid-examples](https://github.com/anaseto/gruid-examples) module offers\nsome simple annotated examples of gruid usage.\n\nYou may want to look also into some real world examples of gruid programs:\n\n+ [harmonist](https://github.com/anaseto/harmonist) : a stealth roguelike game.\n+ [gospeedr](https://github.com/anaseto/gospeedr) : a simple speed reading program.\n\n# See also\n\nIf you need to handle wide-characters, that is characters that take two cells\nin the terminal, you may want to look into\n[go-runewidth](https://github.com/mattn/go-runewidth).\n\nThe [clipboard](https://github.com/atotto/clipboard) module may be of interest\nfor some applications too, as copying and pasting is not handled by gruid. Note\nthat, at this time, the clipboard module does not support the js platform, but\nthere's at least one fork that does.\n\nAs gruid only provides a few map generation algorithms, you may be interested\nin the [dngn](https://github.com/SolarLune/dngn) module, which provides map\ngeneration algorithms too, though its representation of maps is different.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanaseto%2Fgruid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanaseto%2Fgruid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanaseto%2Fgruid/lists"}