Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/liquidev/retrove
A super-simple low resolution canvas scaling library for LÖVE.
https://github.com/liquidev/retrove
love2d lua
Last synced: 15 days ago
JSON representation
A super-simple low resolution canvas scaling library for LÖVE.
- Host: GitHub
- URL: https://github.com/liquidev/retrove
- Owner: liquidev
- Created: 2021-07-31T16:55:20.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-07-31T16:55:35.000Z (over 3 years ago)
- Last Synced: 2024-11-19T12:15:40.383Z (3 months ago)
- Topics: love2d, lua
- Language: Lua
- Homepage:
- Size: 1.95 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# retrove
A super-simple low resolution canvas scaling library for LÖVE.
## Usage
Before retrove can be of any use, it's best to make the window resizable in
`love.conf`:**File:** conf.lua
```lua
function love.conf(t)
t.window.resizable = true
end
```The library interface consists of a single function that renders the pixel
canvas to the currently active canvas. It's worth noting that retrove supports
rendering the scaled pixel canvas to an off-screen canvas, to allow for
post-processing effects.**File:** main.lua
```lua
local retrove = require "retrove"local canvas
function love.load()
canvas = love.graphics.newCanvas(64, 64)
endfunction love.draw()
love.graphics.setCanvas(canvas)-- draw stuff here
love.graphics.setCanvas()
retrove(canvas)
end
```
By default, retrove will render with integer scaling. To instead use fractional
scaling, pass an extra `true` parameter to the `retrove` function:
```lua
retrove(canvas, true)
```## License
This library is freely available under the public domain.