Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ellraiser/love-icon
zero-dependency PNG to ICO/ICNS convertor for LÖVE
https://github.com/ellraiser/love-icon
icns ico love2d lua png
Last synced: 29 days ago
JSON representation
zero-dependency PNG to ICO/ICNS convertor for LÖVE
- Host: GitHub
- URL: https://github.com/ellraiser/love-icon
- Owner: ellraiser
- License: mit
- Created: 2023-12-06T14:53:10.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-06T16:07:08.000Z (about 1 year ago)
- Last Synced: 2024-11-10T01:07:45.687Z (3 months ago)
- Topics: icns, ico, love2d, lua, png
- Language: Lua
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# löve-icon
Zero-dependency icon convertor to turn `.png` into `.ico` and `.icns` files for [LÖVE](https://github.com/love2d/love).> This module is built to work with versions `11.X` and `12.X`
---
## Usage
Simply require the module in your game, some usage examples are shown below. You can also run the `main.lua` file with LÖVE to see some basic examples in action.As this module uses the LÖVE filesystem, your file paths should be relative to [save directory](https://love2d.org/wiki/love.filesystem.getSaveDirectory) or your project path as they are passed directly to `love.filesystem.x`.
```lua
-- load the module
require('love-icon')-- load a given png
local icon = love.icon:newIcon('examples/love-hammer.png')-- create an ico file
local success, err = icon:convertToICO('loveicon/hammer.ico')-- create an icns file
local success, err = icon:convertToICNS('loveicon/hammer.icns')
```---
## Notes
For best results the PNG you use should be at least 256px x 256px. Anything smaller may result in blurry results when shown at higher resolutions.