{"id":15566860,"url":"https://github.com/bigjk/ramen","last_synced_at":"2025-04-11T20:41:32.249Z","repository":{"id":57515848,"uuid":"149114282","full_name":"BigJk/ramen","owner":"BigJk","description":"A simple console emulator for ascii games written in go","archived":false,"fork":false,"pushed_at":"2024-05-30T06:42:06.000Z","size":217,"stargazers_count":66,"open_issues_count":0,"forks_count":6,"subscribers_count":5,"default_branch":"rework","last_synced_at":"2025-04-04T06:36:09.499Z","etag":null,"topics":["ascii","ebiten","game-engine","go","golang","roguelike"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BigJk.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":"2018-09-17T11:23:12.000Z","updated_at":"2025-03-09T18:00:43.000Z","dependencies_parsed_at":"2024-06-19T05:27:30.606Z","dependency_job_id":"34db8861-dbb9-440e-acf7-804d8efcabfa","html_url":"https://github.com/BigJk/ramen","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BigJk%2Framen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BigJk%2Framen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BigJk%2Framen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BigJk%2Framen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BigJk","download_url":"https://codeload.github.com/BigJk/ramen/tar.gz/refs/heads/rework","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248478759,"owners_count":21110757,"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":["ascii","ebiten","game-engine","go","golang","roguelike"],"created_at":"2024-10-02T17:07:38.244Z","updated_at":"2025-04-11T20:41:32.214Z","avatar_url":"https://github.com/BigJk.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://cdn.rawgit.com/BigJk/7e61395616df18c9b6003aa90c77e829/raw/ec7bc03e02015deb0c96c6914f5c0460af773b59/ramen.svg\" width=\"145\" align=\"left\" /\u003e\n\n\u003cimg src=\"https://i.imgur.com/glpKbxk.png\" width=\"10\" height=\"145\" align=\"left\" /\u003e\n\n[![Documentation](https://godoc.org/github.com/BigJk/ramen/console?status.svg)](http://godoc.org/github.com/BigJk/ramen/console) [![Go Report Card](https://goreportcard.com/badge/github.com/BigJk/ramen)](https://goreportcard.com/report/github.com/BigJk/ramen) [![Hex.pm](https://img.shields.io/hexpm/l/plug.svg)](LICENSE)\n\n**ramen** is a simple console emulator written in go that can be used to create various ascii / text (roguelike) games. It's based on the great **[ebiten](https://github.com/hajimehoshi/ebiten)** library and inspired by libraries like **[libtcod](https://github.com/libtcod/libtcod)**.\n\n**Warning:** API and features are not fixed yet. Bugs will happen!\n\n\u003cbr\u003e\n\n## Features\n\n- PNG Fonts with more than 256 chars possible\n- Fonts can contain chars and colored tiles\n- Create sub-consoles to organize rendering\n- Component based ui system\n- Inlined color definitions in strings\n- Pre-build components ready to use\n  - TextBox\n  - Button\n- REXPaint file parsing\n- Everything **ebiten** can do\n  - Input: Mouse, Keyboard, Gamepads, Touches\n  - Audio: MP3, Ogg/Vorbis, WAV, PCM\n  - ...\n\n## Get Started\n\n```\ngo get github.com/BigJk/ramen/...\n```\n\n## Transformer\n\nIn ramen you change the content of the console by applying transformations to cells. Examples would be:\n\n```go\n// set one cell at position 10,15 to a green @:\ncon.Transform(10, 15, t.CharByte('@'), t.Foreground(concolor.RGB(0, 255, 0)))\n\n// change the background of the area 0,0 with the width and height of 25,25:\ncon.TransformArea(0, 0, 25, 25, t.Background(concolor.RGBA(255, 255, 255, 20)))\n\n// change the background of all the cells:\ncon.TransformAll(t.Background(concolor.RGBA(255, 255, 255, 10)))\n```\n\nAll transformer functions accept objects that implement the **t.Transformer** interface, so it's also possible to create transformers with custom behaviour by implementing that interface.\n\n## Inlined Color Definitions\n\nThere are also convenient string printing functions. The **console.Print** function supports parsing of inlined color definitions that can change the forground and background color of parts of the string.\n\n``[[f:#ff0000]]red foreground\\n[[f:#ffffff|b:#000000]]white foreground and black background\\n[[b:#00ff00]]green background``\n\n\u003cimg src=\"./.github/screen_colored_string.png\" width=\"400\"\u003e\n\n## Example\n\n```go\npackage main\n\nimport (\n  \"fmt\"\n  \"github.com/BigJk/ramen/concolor\"\n  \"github.com/BigJk/ramen/console\"\n  \"github.com/BigJk/ramen/font\"\n  \"github.com/BigJk/ramen/t\"\n  \"github.com/hajimehoshi/ebiten/v2\"\n)\n\nfunc main() {\n  // create a 50x30 cells console with the title 'ramen example'\n  con, err := console.New(50, 30, font.DefaultFont, \"ramen example\")\n  if err != nil {\n    panic(err)\n  }\n\n  // set a tick hook. This function will be executed\n  // each tick (60 ticks per second by default) even\n  // when the fps is lower than 60fps. This is a good\n  // place for your game logic.\n  //\n  // The timeDelta parameter is the elapsed time in seconds\n  // since the last tick.\n  con.SetTickHook(func(timeElapsed float64) error {\n    // your game logic\n    return nil\n  })\n\n  // set a pre-render hook. This function will be executed\n  // each frame before the drawing happens. This is a good\n  // place to draw onto the console, because it only executes\n  // if a draw is really about to happen.\n  //\n  // The timeDelta parameter is the elapsed time in seconds\n  // since the last frame.\n  con.SetPreRenderHook(func(screen *ebiten.Image, timeDelta float64) error {\n    con.ClearAll() // clear console \n    con.TransformAll(t.Background(concolor.RGB(50, 50, 50))) // set the background\n\t\n    con.Print(2, 2, \"Hello!\\nTEST\\n Line 3\", t.Foreground(concolor.RGB(0, 255, 0)), t.Background(concolor.RGB(255, 0, 0)))\n    con.Print(2, 7, fmt.Sprintf(\"TPS: %0.2f\\nFPS: %0.2f\\nElapsed: %0.4f\", ebiten.CurrentFPS(), ebiten.CurrentFPS(), timeDelta))\n\t\n    return nil\n  })\n\n  // start the console with a scaling of 1\n  con.Start(1)\n}\n```\n\n## Screenshots\n\n\u003cimg src=\"./.github/screen_colored_tiles.png\" width=\"538\"\u003e\n\u003cimg src=\"./.github/screen_text.png\" width=\"200\"\u003e\n\u003cimg src=\"./.github/screen_comp_shaded.png\" width=\"314\"\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigjk%2Framen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbigjk%2Framen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigjk%2Framen/lists"}