{"id":19350823,"url":"https://github.com/terroo/luasfml","last_synced_at":"2025-04-23T07:30:54.376Z","repository":{"id":47368340,"uuid":"514298636","full_name":"terroo/luasfml","owner":"terroo","description":"Binding SFML to LUA . This project is a fork of the original project: https://github.com/Canadadry/luaSFML","archived":false,"fork":false,"pushed_at":"2022-07-20T15:43:04.000Z","size":144,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-02T09:44:37.704Z","etag":null,"topics":["binding","cplusplus-17","lua","sfml"],"latest_commit_sha":null,"homepage":"https://github.com/terroo/luasfml","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/terroo.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}},"created_at":"2022-07-15T14:27:17.000Z","updated_at":"2025-01-20T21:51:15.000Z","dependencies_parsed_at":"2022-08-21T19:00:36.638Z","dependency_job_id":null,"html_url":"https://github.com/terroo/luasfml","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/terroo%2Fluasfml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terroo%2Fluasfml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terroo%2Fluasfml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terroo%2Fluasfml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/terroo","download_url":"https://codeload.github.com/terroo/luasfml/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250391023,"owners_count":21422829,"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":["binding","cplusplus-17","lua","sfml"],"created_at":"2024-11-10T04:33:59.399Z","updated_at":"2025-04-23T07:30:53.988Z","avatar_url":"https://github.com/terroo.png","language":"C++","readme":"# Lua SFML Binding\nBinding SFML to LUA\n\n![Lua SFML](./assets/luasfml.jpg) \n\n---\n\n# Description\nLuaSFML is a lua binding of SFML, which let's you use SFML in your lua script.\n\u003e This project is a fork of the [original project](https://github.com/Canadadry/luaSFML) which has been stalled for over 9 years and has compilation and other issues.\n\n---\n\n# Dependencies\n+ [gcc/g++](https://gcc.gnu.org/)\n+ [SFML](https://www.sfml-dev.org/)\n+ [Make](https://www.gnu.org/software/make/)\n+ [CMake](https://cmake.org/)\n+ [Lua 5.1](https://www.lua.org/)\n\nExample on Ubuntu\n```bash\nsudo apt update\nsudo apt install build-essential g++ make cmake lua5.1 liblua5.1-0 liblua5.1-0-dev\n```\n\n---\n\n# Building and Instalation\n\n```bash\ngit clone https://github.com/terroo/luasfml\ncd luasfml\nmkdir build \u0026\u0026 cd build\ncmake ..\nmake\nsudo make install\n```\n\n### Got error ?\n```bash\n/usr/bin/ld: could not find -llua: No such file or directory\ncollect2: error: ld returned 1 exit status\nmake[2]: *** [CMakeFiles/luasfml.dir/build.make:801: luasfml] Erro 1\nmake[1]: *** [CMakeFiles/Makefile2:84: CMakeFiles/luasfml.dir/all] Erro 2\nmake: *** [Makefile:136: all] Erro 2\n```\n\nTo fix it on Ubuntu, run the following command:\n\n```bash\nsudo ln -s /usr/lib/x86_64-linux-gnu/liblua5.1.so /usr/lib/x86_64-linux-gnu/liblua.so\n```\n\u003e For other systems `find /usr/lib* -name 'liblua5.1.so'` where the file is and create a symlink in the same directory. Or run the command below:\n```bash\nsudo ln -s $(find /usr/lib* -name 'liblua5.1.so') \\\n           $(find /usr/lib* -name 'liblua5.1.so' | sed 's/5.1//g')\n```\n\nAnd then run `make` again:\n\n```bash\nmake\nsudo make install\n```\n\n---\n\n# Basic Example\nComming soon [Wiki](https://github.com/terroo/luasfml/wiki), In the meantime you can learn by the [Examples/Demos](https://github.com/Canadadry/luaSFML/tree/master/demo) .\n\u003e If you already know [SFML with C++](https://www.sfml-dev.org/documentation/2.5.1/) and also know [Lua](https://www.lua.org/docs.html), you will adapt easily. If you want to contribute to the documentation, feel free.\n\nFile `main.lua`\n\n```lua\nwindow = sfRenderWindow.new(sfVideoMode.new(800,600,32),\"Lua SFML Basic Example\",sfWindowStyle.Default);\n\nclearColor = sfColor.new(0,0,0);\ncolorWhite = sfColor.new(255, 255, 255)\n\nfont = sfFont.new()\nfont:loadFromFile(\"path/to/font.ttf\")\n\nmessage = sfText.new(\"This is Lua SFML!\",font,40);\nmessage:setPosition( 200, 250);\nmessage:setColor(colorWhite)\n\nwhile window:isOpen() do\n  event = sfEvent.new();\n  while window:pollEvent(event) do\n    if(event:type() == sfEventType.Closed) then window:close(); \n    end\n  end\n  window:clear(clearColor);\n  window:draw(message);\n  window:display();\nend\n```\n\nTo run use the `luasfml` command and the name of the *main file* of your project:\n\n```bash\nluasfml main.lua\n```\n\nThis example is available in the [assets](./assets/) directory of that repository. To run:\n\n```bash\ncd assets/\nluasfml main.lua\n```\n\nPossible output:\n\n![Basic Example Lua SFML](./assets/basic-luasfml.jpg) \n\n---\n\n# Similar Projects\n+ [Luna](https://github.com/XyronLabs/Luna)\n+ [lsfml](https://github.com/Oberon00/lsfml)\n+ [LSFML](https://github.com/ief015/LSFML)\n\n---\n\n# Uninstall\n```bash\ngit clone https://github.com/terroo/luasfml\ncd luasfml\nmkdir build \u0026\u0026 cd build\ncmake ..\nsudo make uninstall\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterroo%2Fluasfml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterroo%2Fluasfml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterroo%2Fluasfml/lists"}