{"id":13731739,"url":"https://github.com/dfranx/SFMLight","last_synced_at":"2025-05-08T05:30:40.007Z","repository":{"id":113373200,"uuid":"101567955","full_name":"dfranx/SFMLight","owner":"dfranx","description":"Add lights to your SFML game","archived":false,"fork":false,"pushed_at":"2019-06-27T22:48:23.000Z","size":849,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-14T15:16:55.059Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"CMake","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/dfranx.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":"2017-08-27T17:15:34.000Z","updated_at":"2022-12-09T14:35:17.000Z","dependencies_parsed_at":"2023-04-19T23:32:07.587Z","dependency_job_id":null,"html_url":"https://github.com/dfranx/SFMLight","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/dfranx%2FSFMLight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfranx%2FSFMLight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfranx%2FSFMLight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfranx%2FSFMLight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dfranx","download_url":"https://codeload.github.com/dfranx/SFMLight/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253008360,"owners_count":21839638,"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-03T02:01:37.394Z","updated_at":"2025-05-08T05:30:39.989Z","avatar_url":"https://github.com/dfranx.png","language":"CMake","readme":"# SFMLight\nSFMLight is a simple to use library that can be used to add lighting to your 2D game.\n\n\n## Screenshots\n![example](https://i.imgur.com/Cn0rHCl.png?1)\n\n\n## Getting started\nThese steps will show you how to build SFMLight on your machine.\n\n### Dependencies\nThis project uses:\n* [SFML](https://www.sfml-dev.org/download.php)\n\n### Building\nFirst, get the SFMLight source code\n```\ngit clone https://github.com/dfranx/SFMLight.git SFMLight\ncd SFMLight\n```\n\nThen build it\n```\ncmake .\nmake\n```\n\nIf you get error message which says that SFML was not found on your computer you\nneed to specify SFML_ROOT variable in your cmake command:\n```\ncmake -DSFML_ROOT=path/to/your/sfml .\n```\n\n## Usage\nInclude the library\n```c++\n#include \u003cSFMLight.h\u003e\n```\n\nDeclare a LightScene\n```c++\nsfl::LightScene scene;\nscene.SetDebugDraw(true); // just for debugging\n```\n\nDeclare an object/obstacle and define it's boundaries\n```c++\nsfl::Object obj;\nobj.Add(50, 50);\nobj.Add(100, 50);\nobj.Add(100, 100);\nobj.Add(50, 100);\n```\n\nAdd the object to the scene\n```c++\nscene.Add(obj);\n```\n\nCreate a light and define some of its properties (radius and position)\n```c++\nsfl::Light light;\nlight.SetRadius(300);\nlight.SetPosition(sf::Vector2f(150, 150));\n```\n\nUpdate light's vertices\n```c++\nscene.Update(light);\n```\n\nRender everything\n```c++\nlight.Render(window);\nscene.Render(window);\n```\n\nResult:\n\n![test](https://i.imgur.com/eEVs1hD.png?1)\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details\n","funding_links":[],"categories":["Graphics"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfranx%2FSFMLight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdfranx%2FSFMLight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfranx%2FSFMLight/lists"}