{"id":13804053,"url":"https://github.com/ArtemkaKun/polygon-editor","last_synced_at":"2025-05-13T17:31:04.555Z","repository":{"id":176499402,"uuid":"656335566","full_name":"ArtemkaKun/polygon-editor","owner":"ArtemkaKun","description":"A tool to create and edit 2D polygons with sprite lookup, created in V","archived":true,"fork":false,"pushed_at":"2023-07-12T09:01:19.000Z","size":37,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-13T15:59:53.633Z","etag":null,"topics":["2d","collider","collider2d","editor","game-development","gamedev","polygon","sprite","ui","v","vlang","vlang-tool"],"latest_commit_sha":null,"homepage":"","language":"V","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/ArtemkaKun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["ArtemkaKun","medvednikov"],"ko_fi":"yuart"}},"created_at":"2023-06-20T18:32:19.000Z","updated_at":"2023-12-29T17:04:50.000Z","dependencies_parsed_at":"2024-06-19T03:02:46.238Z","dependency_job_id":"bcb6c924-0fc1-4fe6-b83c-a1ba46c0b7eb","html_url":"https://github.com/ArtemkaKun/polygon-editor","commit_stats":null,"previous_names":["artemkakun/polygon-editor"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtemkaKun%2Fpolygon-editor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtemkaKun%2Fpolygon-editor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtemkaKun%2Fpolygon-editor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtemkaKun%2Fpolygon-editor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArtemkaKun","download_url":"https://codeload.github.com/ArtemkaKun/polygon-editor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225247822,"owners_count":17444121,"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","collider","collider2d","editor","game-development","gamedev","polygon","sprite","ui","v","vlang","vlang-tool"],"created_at":"2024-08-04T01:00:40.919Z","updated_at":"2024-11-18T20:31:29.440Z","avatar_url":"https://github.com/ArtemkaKun.png","language":"V","funding_links":["https://github.com/sponsors/ArtemkaKun","https://github.com/sponsors/medvednikov","https://ko-fi.com/yuart"],"categories":["Applications"],"sub_categories":["Editors"],"readme":"\u003ch1 align=\"center\"\u003ePolygon Editor\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/ArtemkaKun/polygon-editor/assets/36485221/88afe641-bf52-4e08-8df5-7a09860652c5/polygoneditordemo.gif\" alt=\"animated\" /\u003e\n\u003c/p\u003e\n\n## About\n\nPolygon Editor is a desktop application designed for game developers to create and edit 2D polygon\nshapes to be used as colliders in their games. Compatible with Linux systems (only ⚠️),\nit's built using the [V](https://vlang.io/) programming language and\n[V UI](https://github.com/vlang/ui) framework, offering a fast and lightweight tool.\nThis project is open-source and is licensed under the MIT license.\n\n## Key Features\n\n- Sprite and Polygon loading: Load sprites (PNG) and existing polygons (JSON) for editing.\n- Polygon drawing: Draw polygons on the loaded sprite by adding points with left mouse clicks.\n- Point modification: Modify polygons by moving the points around.\n- Point deletion: Remove points from the polygon via right-click.\n- Status indications: Display status messages like \"Polygon saved\", \"Sprite opened\", etc.\n\n## Dependencies\n\n- [kdialog](https://github.com/KDE/kdialog)\n\n## Usage\n\n1. Begin by selecting a sprite that will serve as your reference for creating a polygon.\nYou can do this by navigating to `File...` then selecting `Open sprite file`.\n2. After your sprite is loaded, create a new polygon file. This can be done by going to `File...`\nand choosing `Create new polygon`.\n3. You can now start shaping your polygon. Left-click with your mouse to add points.\nIf you need to remove points, a right-click will do the trick. To reposition a point, simply press\nand hold the left mouse button and drag the point to your desired location.\n4. Once you're satisfied with your polygon, ensure to save your work.\nNavigate to `File...` and then `Save polygon`. Your polygon will now be safely stored\nfor future use or modification.\n\n## User Interface\n\nThe UI consists of a panel bar at the top and a viewport. The panel bar includes a \"File...\" button\nthat provides a dropdown menu with options for opening and saving sprites and polygons.\nThe viewport displays the loaded sprite and the drawn polygon.\n\n## Export\n\nExport polygons as JSON files (`Polygon` structure from\n[v-2d-polygon-colliders](https://github.com/ArtemkaKun/v-2d-polygon-colliders) library).\nEach point is represented by an object (`Position` structure from\n[v-2d-transform](https://github.com/ArtemkaKun/v-2d-transform) library) with x and y properties\nfor its coordinates.\n\n\u003e **Note**\n\u003e\n\u003e It's crucial to remember that these point positions are not based on global coordinates, but\n\u003e rather they exist within the local space of the sprite used as a reference.\n\u003e This means that their position is defined relative to the origin point of the sprite, rather\n\u003e than the overall coordinate system.\n\u003e See [Local to Global](https://github.com/ArtemkaKun/polygon-editor/blob/8b6ac741194e540bae5f0def6c92e1733d8eb942/src/viewport/viewport.v#L82)\n\u003e and [Global to Local](https://github.com/ArtemkaKun/polygon-editor/blob/8b6ac741194e540bae5f0def6c92e1733d8eb942/src/viewport/viewport.v#L118)\n\u003e conversions examples.\n\n```json\n{\n   \"points\":[\n      {\n         \"Vector\":{\n            \"x\":0.05,\n            \"y\":4.05\n         }\n      },\n      {\n         \"Vector\":{\n            \"x\":1.0,\n            \"y\":2.0\n         }\n      },\n      {\n         \"Vector\":{\n            \"x\":3.05,\n            \"y\":0.0\n         }\n      }\n   ]\n}\n```\n\n## Future Enhancements\n\n- [ ] Dynamic zoom\n- [ ] Undo/redo functionality\n- [ ] Pixel precision grid\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first to discuss what\nyou would like to change.\n\n## Donations\n\nIf you like this project, please consider donating to me or the V language project.\nYour donations will help me to continue to develop this project and the V language.\n\n## More about my projects\n\nSubscribe to [my Mastodon account](https://mastodon.social/@yuart) to find more info\nabout my projects.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FArtemkaKun%2Fpolygon-editor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FArtemkaKun%2Fpolygon-editor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FArtemkaKun%2Fpolygon-editor/lists"}