{"id":36877669,"url":"https://github.com/lamonin/uilinedrawer","last_synced_at":"2026-02-10T13:01:41.932Z","repository":{"id":331550057,"uuid":"1128920390","full_name":"Lamonin/UILineDrawer","owner":"Lamonin","description":"Spline-based line renderer for Unity UI Canvas.","archived":false,"fork":false,"pushed_at":"2026-02-09T07:01:11.000Z","size":3702,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-09T07:51:09.314Z","etag":null,"topics":["bezier","canvas","csharp","raycasting","spline","unity","unity-ui","unity3d"],"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/Lamonin.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-06T10:43:11.000Z","updated_at":"2026-02-09T06:46:40.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Lamonin/UILineDrawer","commit_stats":null,"previous_names":["lamonin/uilinedrawer"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Lamonin/UILineDrawer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lamonin%2FUILineDrawer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lamonin%2FUILineDrawer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lamonin%2FUILineDrawer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lamonin%2FUILineDrawer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lamonin","download_url":"https://codeload.github.com/Lamonin/UILineDrawer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lamonin%2FUILineDrawer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29299545,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-10T12:55:56.056Z","status":"ssl_error","status_checked_at":"2026-02-10T12:55:55.692Z","response_time":65,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bezier","canvas","csharp","raycasting","spline","unity","unity-ui","unity3d"],"created_at":"2026-01-12T15:14:39.812Z","updated_at":"2026-02-10T13:01:41.923Z","avatar_url":"https://github.com/Lamonin.png","language":"C#","readme":"# UILineDrawer (WIP)\n\n**UILineDrawer** is a Unity UI component for rendering smooth, high-quality lines directly inside the **Canvas** system.\nIt is designed for precise visual output and accurate interaction, using optimized mesh generation and spline-based curves.\n\nThe component is built on top of the custom Bezier spline implementation and supports adjustable thickness, configurable curve resolution, and robust raycasting directly along the rendered line.\n\nUILineDrawer was developed and production-tested in the\n[Д.И.В.О.](https://games.kruzhok.org/games_library/338) project (more in [Showcase](#showcase) section).\n\n\u003cdetails open\u003e\n    \u003csummary\u003eLine Example\u003c/summary\u003e\n\n4 point spline with subdivision level 1 (gizmos enabled)\n\n![Line Example](images/example_1.png)\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary\u003eMesh Generation\u003c/summary\u003e\n\n![Line Mesh Example](images/mesh_example.gif)\n\n\u003c/details\u003e\n\n---\n\n## Motivation\n\nUnity provides the built-in `LineRenderer` component, but integrating it into a **Canvas-based UI** requires non-trivial camera setup and workarounds.\n\nWhen development of this component began (05.2025), existing solutions did not support **precise interaction with the line geometry**. Input events were handled for the entire bounding rectangle instead of the actual rendered line, making accurate UI interaction impossible.\n\nUILineDrawer was created to solve this limitation.\n\n---\n\n## Features\n\n- **Made for Canvas**: the component is designed for simple and effective operation within the Unity Canvas environment.\n\n  - **Mask Support**: full support for Rect2D and Mask masks.\n\n    ![Masks Example](images/mask_example.gif)\n\n  - **Raycast Support**: full raycast support.\n\n    ![Raycast Example](images/raycast_example.gif)\n\n- **Runtime API**: full C# API to add, remove, and modify spline points and visual properties at runtime.\n\n- **Sprite Support**: optional sprite-based rendering with configurable UV tiling.\n\n- **Gradient Support**: per-line gradient mode in addition to solid color.\n\n- **[Experimental] Material Support**: this is not necessary for my use cases, so this functionality has not been tested.\n\n---\n\n## Dependencies\n\nThis package depends on the following Unity packages:\n\n- **Mathematics** (`com.unity.mathematics`)\n\nMake sure it installed via the Package Manager if they not installed automatically.\n\n---\n\n## Installation\n\n```\nhttps://github.com/Lamonin/UILineDrawer.git?path=/Assets/UILineDrawer/#0.4.0\n```\n\n1. Open **Window** → **Package Manager**.\n2. Press the + button, choose \"**Add package from git URL...**\"\n3. Enter url above and press **Add**.\n\n---\n\n## Usage\n\n### Editor Setup\n\n1. Create a **Canvas** in your scene.\n2. Add an empty **GameObject** as a child of the Canvas.\n3. Attach the `UILineDrawer` component.\n4. Adjust **Thickness**, **Color**, and spline points in the Inspector.\n\n---\n\n### Runtime Example\n\n```csharp\nusing UnityEngine;\nusing Unity.Mathematics;\nusing Maro.UILineDrawer;\n\npublic class LineController : MonoBehaviour\n{\n    [SerializeField]\n    private UILineDrawer lineDrawer;\n\n    void Start()\n    {\n        lineDrawer.AddPoint(new Vector2(-50, 0));\n\n        lineDrawer.AddPoint(\n            position: new Vector2(0, 50),\n            tangentIn: new Vector2(-25, 0),\n            tangentOut: new Vector2(25, 0),\n            rotation: 0\n        );\n\n        lineDrawer.AddPoint(new Vector2(50, 0));\n\n        lineDrawer.Thickness = 10f;\n        lineDrawer.color = Color.red;\n    }\n}\n```\n\n---\n\n## Configuration\n\n| Property                       | Description                                                                          |\n| ------------------------------ | ------------------------------------------------------------------------------------ |\n| **Points**                     | Control points defining the spline curve.                                            |\n| **Thickness**                  | Visual width of the line.                                                            |\n| **Sprite**                     | Optional sprite texture used for the line.                                           |\n| **Tiling**                     | Controls texture repetition along the line path.                                     |\n| **Use Gradient / Gradient**    | Enables gradient coloring along the full line length.                                |\n| **Raycast Extra Thickness**    | Adds invisible padding to improve clickability of thin lines.                        |\n| **Raycast Start / End Offset** | Excludes interaction near the start or end of the line (useful for fades).           |\n| **Subdivisions**               | Curve resolution. Higher values produce smoother lines at the cost of more vertices. |\n\n---\n\n## Known Limitations\n\n- **Work in Progress**: this package is actively developed. APIs and internal logic may change.\n\n- **2D UI Space Only**: the component is designed specifically for the Canvas (XY plane).\n\n- **Performance Trade-off**: implementation prioritizes visual quality, mask and raycast support over maximum performance, using polygons efficiently to achieve clean and smooth line rendering. Perfect for mostly static lines.\n\n---\n\n## Showcase\n\n### [Д.И.В.О.](https://games.kruzhok.org/games_library/338)\n\nThis package was originally developed and actively used to build a **visual node editor** for this project.\n\n![Analyser](images/divo_analyser.png)\n\n\u003e UILineDrawer is used to render connection lines between nodes and to handle interaction (click detection) on those lines.\n\n---\n\n## License\n\nUILineDrawer is distributed under the **MIT License**.\nSee the [LICENSE](LICENSE) file for full license text.\n\nAll contributions to this repository are assumed to be licensed under the MIT License.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flamonin%2Fuilinedrawer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flamonin%2Fuilinedrawer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flamonin%2Fuilinedrawer/lists"}