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: 9 months 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 4 years ago)
- Default Branch: master
- Last Pushed: 2021-07-31T16:55:35.000Z (over 4 years ago)
- Last Synced: 2025-01-20T14:38:54.821Z (about 1 year 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)
end
function 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.