{"id":13526553,"url":"https://github.com/kikito/love-loader","last_synced_at":"2025-10-11T09:37:06.024Z","repository":{"id":2332728,"uuid":"3294425","full_name":"kikito/love-loader","owner":"kikito","description":"Threaded resource loading for LÖVE","archived":false,"fork":false,"pushed_at":"2025-03-25T13:54:01.000Z","size":8813,"stargazers_count":141,"open_issues_count":7,"forks_count":17,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-08-20T22:47:14.777Z","etag":null,"topics":["lua"],"latest_commit_sha":null,"homepage":"http://love2d.org","language":"Lua","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/kikito.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE.txt","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}},"created_at":"2012-01-29T00:26:13.000Z","updated_at":"2025-07-06T03:01:34.000Z","dependencies_parsed_at":"2025-08-20T22:32:37.514Z","dependency_job_id":"3f19b0df-0b44-484f-8708-2293bcf916d9","html_url":"https://github.com/kikito/love-loader","commit_stats":{"total_commits":40,"total_committers":8,"mean_commits":5.0,"dds":0.575,"last_synced_commit":"49ccdfd06496e4eaffe8f3444ea363adcf5bd049"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/kikito/love-loader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kikito%2Flove-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kikito%2Flove-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kikito%2Flove-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kikito%2Flove-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kikito","download_url":"https://codeload.github.com/kikito/love-loader/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kikito%2Flove-loader/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279006748,"owners_count":26084181,"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","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["lua"],"created_at":"2024-08-01T06:01:31.456Z","updated_at":"2025-10-11T09:37:05.993Z","avatar_url":"https://github.com/kikito.png","language":"Lua","funding_links":[],"categories":["Utilities"],"sub_categories":[],"readme":"love-loader\n===========\n\nThis is an utility lib for [LÖVE](http://love2d.org) that loads\nresources (images, sounds) from the hard disk on a separate thread.\n\nThis allows for \"doing stuff\" while resources are being loaded; for\nexample, playing an animation. The fact that the blocking calls happen\nin a separate thread ensures that the animation is fluid, without\nblocking calls dropping the framerate.\n\nVersion 2.0.0 of this lib only works with LÖVE 0.9.x. If you need to\nwork with LÖVE 0.8 or before, please use earlier versions of this lib.\n\nThis repository is maintained by Tanner Rogalsky (https://github.com/TannerRogalsky).\n\nExample\n=======\n\n```lua\nlocal loader = require 'love-loader'\n\nlocal images = {}\nlocal sounds = {}\n\nlocal finishedLoading = false\n\nfunction love.load()\n  loader.newImage(  images, 'rabbit', 'path/to/rabbit.png')\n  loader.newSource( sounds, 'iiiik',  'path/to/iiik.ogg', 'static')\n  loader.newSource( sounds, 'music',  'path/to/music.ogg', 'stream')\n\n  loader.start(function()\n    finishedLoading = true\n  end)\nend\n\nfunction love.update(dt)\n  if not finishedLoading then\n    loader.update() -- You must do this on each iteration until all resources are loaded\n  end\nend\n\nfunction love.draw()\n  if finishedLoading then\n    -- media contains the images and sounds. You can use them here safely now.\n    love.graphics.draw(images.rabbit, 100, 200)\n  else -- not finishedLoading\n    local percent = 0\n    if loader.resourceCount ~= 0 then percent = loader.loadedCount / loader.resourceCount end\n    love.graphics.print((\"Loading .. %d%%\"):format(percent*100), 100, 100)\n  end\nend\n```\n\nYou can also see a working demo in the\n[demo branch of this repo](https://github.com/kikito/love-loader/tree/demo).\n\nInterface\n=========\n\n* `loader.newImage(holder, key, path)`. Adds a new image to the list\n  of images to load.\n* `loader.newSource(holder, key, path, sourceType)`. Adds a new source\n  to the list of sources to load.\n* `loader.newFont(holder, key, path)`. Adds a new font to the list of\n  fonts to load.\n* `loader.start(finishCallback, loadedCallback)`. Starts doing the\n  loading on a separate thread. When it finishes, it invokes\n  `finishCallback` with no parameters. Every time it loads a new\n  resource, it invokes `loadedCallback`. `finishedCallback` admits no\n  parameters, and `loadedCallback`'s signature is\n  `function(kind, holder, key)`. `kind` is a string (\"image\", \"source\"\n  or \"stream\"). Neither `loadedCallback` or `finishedCallback` are\n  mandatory.\n* `loader.loadedCount` integer returning the number of resources\n  loaded. When `loader.start` gets invoked, it's 0.\n* `loader.resourceCount` integer containing the total number of\n  resources to be loaded. It can be used in conjunction with\n  `loader.loadedCount` to show progressbars etc.\n\nInstallation\n============\n\nJust copy the love-loader.lua file somewhere in your projects (maybe\ninside a /lib/ folder) and require it accordingly.\n\nRemember to store the value returned by require somewhere! (I suggest a\nlocal variable named `loader` or `love.loader`)\n\n```lua\nlocal loader = require 'love-loader'\n```\n\nThe second step is making sure that your \"game loop\" calls\n`loader.update`, at least while there are resources to load.\n\nLicense\n=======\n\nThis library is distributed under the MIT License.\n\nCredits\n=======\n\nI took a lot of inspiration from Michael Enger's Stealth2D project. I\nlearned the basic internals of threads from his loading state code.\n\nhttps://github.com/michaelenger/Stealth2D\n\nTanner Rogalsky (https://github.com/TannerRogalsky) ported the library\nto LÖVE 0.9.0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkikito%2Flove-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkikito%2Flove-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkikito%2Flove-loader/lists"}