{"id":19599739,"url":"https://github.com/starwing/lua-nanovg","last_synced_at":"2025-04-27T16:32:09.594Z","repository":{"id":29159053,"uuid":"32689407","full_name":"starwing/lua-nanovg","owner":"starwing","description":"Lua bindings for nanovg.","archived":false,"fork":false,"pushed_at":"2023-12-17T14:20:21.000Z","size":193,"stargazers_count":33,"open_issues_count":1,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-05T01:32:13.913Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/starwing.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":"2015-03-22T18:39:58.000Z","updated_at":"2025-01-21T15:22:14.000Z","dependencies_parsed_at":"2024-11-11T09:12:30.480Z","dependency_job_id":"b3b2a68f-dfbe-4cff-821b-9eb5afe6b617","html_url":"https://github.com/starwing/lua-nanovg","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starwing%2Flua-nanovg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starwing%2Flua-nanovg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starwing%2Flua-nanovg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starwing%2Flua-nanovg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/starwing","download_url":"https://codeload.github.com/starwing/lua-nanovg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251171450,"owners_count":21547112,"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-11-11T09:12:17.459Z","updated_at":"2025-04-27T16:32:09.260Z","avatar_url":"https://github.com/starwing.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"## lua-nanovg: Lua bindings for NanoVG and NanoSVG\n\nlua-nanovg is a Lua binding library for [NanoVG](https://github.com/memononen/nanovg/) and [NanoSVG](https://github.com/memononen/nanosvg/).\n\nIt runs on OSX, GNU/Linux and on Windows (MSYS2/MinGW) and requires \n[Lua](http://www.lua.org/) (\u003e=5.3)\nand [GLFW](http://www.glfw.org/download.html) (\u003e=3.1).\n\n_Author:_ _[Xavier Wang](https://github.com/starwing)_\n\n[![Lua logo](./doc/powered-by-lua.gif)](http://www.lua.org/)\n\n#### License\n\nMIT/X11 license (same as Lua). See [LICENSE](./LICENSE).\n\n#### Documentation\n\nSee the [Reference Manual](https://starwing.github.io/lua-nanovg/doc/index.html).\n\n#### Getting and installing\n\nSetup the build environment as described [here](https://github.com/stetre/moonlibs), then:\n\n```sh\n$ git clone https://github.com/starwing/lua-nanovg\n$ git submodule init\n$ git submodule update\n$ cd lua-nanovg\nlua-nanovg$ make\nlua-nanovg$ make install # or 'sudo make install' (Ubuntu)\n```\n\n#### Example\n\n```lua\n-- Script: hello.lua\nlocal nvg = require \"nvg\"\nlocal glfw = require(\"moonglfw\")\n-- Allocate a window and deal with OpenGL\nw = glfw.create_window(640, 480, \"Hello world!\")\nglfw.make_context_current(w)\n-- Only after this we can use nanovg\nlocal canvas = nvg.new \"antialias\"\n-- Repeatedly poll for events:\nwhile not glfw.window_should_close(w) do\n  if glfw.get_key(w, \"escape\") == 'press' then break end\n  t = glfw.get_time()\n  ww, wh = glfw.get_window_size(w)\n  mx, my = glfw.get_cursor_pos(w)\n  local pw, _ = glfw.get_framebuffer_size(w)\n  local ratio = pw/ww\n  canvas:beginFrame(ww, wh, ratio)\n  canvas:clear \"#4C4C51\"\n  canvas:roundedRect((ww-320)/2, (wh-240)/2, 320, 240, 3)\n  canvas.fillStyle = \"rgba(128,30,34,100)\"\n  canvas:fill()\n  canvas:endFrame()\n  glfw.swap_buffers(w)\n  glfw.poll_events()\nend\n```\n\nThe script can be executed at the shell prompt with the standard Lua interpreter:\n\n```shell\n$ lua hello.lua\n```\n\nOther examples can be found in the **examples/** directory contained in the release package.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstarwing%2Flua-nanovg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstarwing%2Flua-nanovg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstarwing%2Flua-nanovg/lists"}