{"id":13568178,"url":"https://github.com/endlesstravel/Love2dCS","last_synced_at":"2025-04-04T04:30:55.214Z","repository":{"id":143423609,"uuid":"111911813","full_name":"endlesstravel/Love2dCS","owner":"endlesstravel","description":"C# Wrapper for LÖVE, a 2d game engine","archived":false,"fork":false,"pushed_at":"2024-03-23T21:25:51.000Z","size":88692,"stargazers_count":173,"open_issues_count":41,"forks_count":14,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-28T23:06:22.567Z","etag":null,"topics":["2d-game-engine","csharp","game-engine","love2d"],"latest_commit_sha":null,"homepage":"","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/endlesstravel.png","metadata":{"files":{"readme":"README-getting-started.md","changelog":"changelog.txt","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-11-24T11:38:28.000Z","updated_at":"2025-03-25T05:26:28.000Z","dependencies_parsed_at":"2024-05-04T23:45:11.465Z","dependency_job_id":null,"html_url":"https://github.com/endlesstravel/Love2dCS","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endlesstravel%2FLove2dCS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endlesstravel%2FLove2dCS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endlesstravel%2FLove2dCS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endlesstravel%2FLove2dCS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/endlesstravel","download_url":"https://codeload.github.com/endlesstravel/Love2dCS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247123072,"owners_count":20887259,"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":["2d-game-engine","csharp","game-engine","love2d"],"created_at":"2024-08-01T14:00:21.283Z","updated_at":"2025-04-04T04:30:50.205Z","avatar_url":"https://github.com/endlesstravel.png","language":"C#","funding_links":[],"categories":["C# #"],"sub_categories":[],"readme":"\nGetting Started\n---\n\n1. Create a C# console application\n\n2. Please [install](https://endlesstravel.github.io/#/tutorial/01.install) Love2dCS from NuGet to your Visual Studio first.\n\n3. Put the following code in the file(maybe Program.cs), and save it.\n``` C#\nusing Love;\nnamespace Example\n{\n    class Program : Scene\n    {\n        public override void Draw()\n        {\n            Graphics.Print(\"Hello World!\", 400, 300);\n        }\n\n        public override void Update(float dt)\n        {\n            // update every frame here ..\n        }\n\n        static void Main(string[] args)\n        {\n            Boot.Run(new Program());\n        }\n    }\n}\n```\n\nthe method of `Scene` will  be called just as it is named :\n\n``` C#\nKeyPressed(KeyConstant key, Scancode scancode, bool isRepeat)\nKeyReleased(KeyConstant key, Scancode scancode)\nMouseMoved(float x, float y, float dx, float dy, bool isTouch)\nMousePressed(float x, float y, int button, bool isTouch)\nMouseReleased(float x, float y, int button, bool isTouch)\nMouseFocus(bool focus)\nWheelMoved(int x, int y)\nJoystickPressed(Joystick joystick, int button)\nJoystickReleased(Joystick joystick, int button)\nJoystickAxis(Joystick joystick, float axis, float value)\nJoystickHat(Joystick joystick, int hat, Joystick.Hat direction)\nJoystickGamepadPressed(Joystick joystick, Joystick.GamepadButton button)\nJoystickGamepadReleased(Joystick joystick, Joystick.GamepadButton button)\nJoystickGamepadAxis(Joystick joystick, Joystick.GamepadAxis axis, float value)\nJoystickAdded(Joystick joystick)\nJoystickRemoved(Joystick joystick)\nTouchMoved(long id, float x, float y, float dx, float dy, float pressure)\nTouchPressed(long id, float x, float y, float dx, float dy, float pressure)\nTouchReleased(long id, float x, float y, float dx, float dy, float pressure)\nTextEditing(string text, int start, int end)\nTextInput(string text)\nWindowFocus(bool focus)\nWindowVisible(bool visible)\nWindowResize(int w, int h)\nDirectoryDropped(string path)\nFileDropped(File file)\nQuit()\nLowMemory()\nLoad()\nUpdate(float dt)\nDraw()\n```\n\n5. Run game : `Debug/Start Debugging` or press `F5`\n\nMore examples\n---\n\n* Drawing an image\n``` C#\nusing Love;\nnamespace Example\n{\n    class Program : Scene\n    {\n        Image img = null;\n\n        public override void Load()\n        {\n            img = Graphics.NewImage(\"logo.png\");\n        }\n\n        public override void Update(float dt)\n        {\n            // update every frame here ..\n        }\n\n        public override void Draw()\n        {\n            Graphics.Draw(img, 300, 200);\n        }\n\n        static void Main(string[] args)\n        {\n            Boot.Run(new Program());\n        }\n    }\n}\n```\n\n* Playing a sound\n``` C#\nusing Love;\nnamespace Example\n{\n    class Program : Scene\n    {\n        Source source = null;\n\n        public override void Load()\n        {\n            source = Audio.NewSource(\"music.mp3\");\n            source.play();\n        }\n\n        public override void Update(float dt)\n        {\n            // update every frame here ..\n        }\n\n        static void Main(string[] args)\n        {\n            Boot.Run(new Program());\n        }\n    }\n}\n```\n\n* Key event handle - Press `Escape` to exit\n``` C#\nusing Love;\nnamespace Example\n{\n    class Program : Scene\n    {\n        public override void KeyPressed(KeyConstant key, Scancode scancode, bool isRepeat)\n        {\n            if (KeyConstant.Escape == key)\n                Event.Quit();\n        }\n\n        public override void Update(float dt)\n        {\n            // update every frame here ..\n        }\n\n        static void Main(string[] args)\n        {\n            Boot.Run(new Program());\n        }\n    }\n}\n```\n\n* Emptye projcet - `no-game` Sence will automatically run\n``` C#\nclass Program\n{\n    static void Main(string[] args)\n    {\n        Love.Boot.Run();\n    }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fendlesstravel%2FLove2dCS","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fendlesstravel%2FLove2dCS","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fendlesstravel%2FLove2dCS/lists"}