{"id":13526506,"url":"https://github.com/Nawias/bar128-love","last_synced_at":"2025-04-01T07:32:44.444Z","repository":{"id":237022458,"uuid":"793648088","full_name":"Nawias/bar128-love","owner":"Nawias","description":"Barcode rendering library for LÖVE","archived":false,"fork":false,"pushed_at":"2024-04-30T19:07:51.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T07:17:51.964Z","etag":null,"topics":["barcode-generator","code128","love2d","love2d-library"],"latest_commit_sha":null,"homepage":"https://github.com/Nawias/bar128-love","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nawias.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-04-29T15:59:44.000Z","updated_at":"2024-07-18T16:32:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"97af601b-3a4d-42ae-8df1-905c0483af70","html_url":"https://github.com/Nawias/bar128-love","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"ad91805acf755c6a45c098b17390b73966d59013"},"previous_names":["nawias/bar128-love"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nawias%2Fbar128-love","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nawias%2Fbar128-love/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nawias%2Fbar128-love/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nawias%2Fbar128-love/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nawias","download_url":"https://codeload.github.com/Nawias/bar128-love/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246600849,"owners_count":20803495,"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":["barcode-generator","code128","love2d","love2d-library"],"created_at":"2024-08-01T06:01:30.745Z","updated_at":"2025-04-01T07:32:39.424Z","avatar_url":"https://github.com/Nawias.png","language":"Lua","funding_links":[],"categories":["Utilities"],"sub_categories":[],"readme":"# bar128-love\n\n**Barcode rendering library for LÖVE**, based on Zanstra's JS implementation ([code128.js](https://zanstra.com/my/Barcode/code128.js)).\n\n## Installation\n\nYou can simply download the `bar128.lua` file from the [GitHub repository](https://github.com/Nawias/bar128-love) and include it in your LÖVE project.\n\n## Usage\n\nHere's an example of how to use the library in a LÖVE program:\n\n```lua\nlocal Barcode = require(\"bar128\")\n\nfunction love.load()\n    -- Create a new Barcode object with the code \"12345\"\n    barcode = Barcode(\"12345\")\nend\n\nfunction love.draw()\n    -- Draw the barcode at position (100, 100)\n    barcode:draw('notext', 100, 100)\nend\n```\n\nThis example will render a barcode with the code \"12345\" at position (100, 100).\n\n## Public Methods\n\n### Constructor\n\n#### `Barcode(code: string|number, barHeight: number, barWidth: number, barcodeType: 'A'|'B'|'C'): Barcode`\n\nCreates a new Barcode object with the specified parameters:\n\n- `code`: The text to be encoded in the barcode.\n- `barHeight`: The height of the barcode image in pixels (default: 20).\n- `barWidth`: The width of one bar in pixels (default: 1).\n- `barcodeType`: The code 128 character set to use (`'A'`, `'B'` or `'C'`). If not provided, the library will detect the charset automatically.\n\n### Drawing\n\n#### `draw(text: 'notext'|'text', x: number, y: number)`\n\nDraws the barcode on the screen.\n\n- `text`: ~~Indicates whether the text representation should be drawn underneath the barcode.~~ Coming Soon™.\n- `x`: The X coordinate of the top-left corner of the barcode.\n- `y`: The Y coordinate of the top-left corner of the barcode.\n\n\u003e ℹ️ Note that the X/Y position accounts for the initial 'quiet zone' of the barcode.\n\n### Getters and Setters\n\n#### `getCode(): string|number`\n\nReturns the current barcode value.\n\n#### `setCode(code: string|number, barcodeType: 'A'|'B'|'C')`\n\nChanges the barcode's value.\n\n- `code`: The new barcode value.\n- `barcodeType`: (Optional) The code 128 character set to use (`'A'`, `'B'` or `'C'`). If not provided, the library will detect the charset automatically.\n\u003e ⚠️ Warning: changing the value causes the barcode to be re-parsed internally. Don't use this too often. \n\n#### `getBarWidth(): number`\n\nReturns the current bar width.\n\n#### `setBarWidth(width: number)`\n\nChanges the base width of bars.\n\n- `width`: The new bar width in pixels.\n\n#### `getBarHeight(): number`\n\nReturns the current barcode height.\n\n#### `setBarHeight(height: number)`\n\nChanges the barcode's height.\n\n- `height`: The new barcode height in pixels.\n\n#### `getFullWidth(): number`\n\nReturns total width of the barcode.\n\n#### `getFullSize(): number, number`\n\nReturns total size of the barcode.\n\n\u003e ⚠️ Warning: the result of `getFullWidth` gets cached, so the first invocation after `setCode` or `setBarWidth` will take slightly longer. `getFullSize` also uses `getFullWidth` under the hood.\n\n## License\n\nThis library is licensed under the MIT License. See the [bar128.lua](https://github.com/Nawias/bar128-love/blob/master/bar128.lua) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNawias%2Fbar128-love","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNawias%2Fbar128-love","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNawias%2Fbar128-love/lists"}