Gröve
Hey guys! I've written some tools for my personal projects and decided to release them in libraries. Most of them are really simple, but may be useful for beginners or game jam projects.
animation.lua: Create animations using image sequences.
chainshaders.lua: Apply multiple shaders at once.
color.lua: Blend, convert and interpolate colors.
draworder.lua: Adds a layer system, allowing you to call functions in a specific order.
resolution.lua: Helps your game to fit in any window size.
Github repository
Gröve: Mini graphics libraries for love2d.
- FloatingBanana
- Prole
- Posts: 22
- Joined: Sat Mar 02, 2019 4:57 pm
- Contact:
Gröve: Mini graphics libraries for love2d.
Code: Select all
if anyMistake(self.english) then
print("Sorry, english is not my first language")
end
Re: Gröve: Mini graphics libraries for love2d.
Ooo - I'll check out that resolution module for sure. I've been procrastinating about solving this problem. Does it scale windows and donuts and images?
Thanks for your contribution.
Thanks for your contribution.
Last project:
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
Turn-based PBEM horse stable (racing) management sim: https://togfox.itch.io/horse-stable-manager
https://discord.gg/HeHgwE5nsZ
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
Turn-based PBEM horse stable (racing) management sim: https://togfox.itch.io/horse-stable-manager
https://discord.gg/HeHgwE5nsZ
Re: Gröve: Mini graphics libraries for love2d.
Well, good job
It looks interesting
It looks interesting
- FloatingBanana
- Prole
- Posts: 22
- Joined: Sat Mar 02, 2019 4:57 pm
- Contact:
Re: Gröve: Mini graphics libraries for love2d.
The resolution module scales everything on the screen to fit inside the window. Let's say your game is designed to run in a 800x600 window, but you also want the user to be able to maximize or resize the window. This module will pick the desired size and scale the game to match the current window size. Here is a example:
Code: Select all
if anyMistake(self.english) then
print("Sorry, english is not my first language")
end
Re: Gröve: Mini graphics libraries for love2d.
Great. And I just noticed I said donuts! That is meant to be fonts!
Last project:
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
Turn-based PBEM horse stable (racing) management sim: https://togfox.itch.io/horse-stable-manager
https://discord.gg/HeHgwE5nsZ
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
Turn-based PBEM horse stable (racing) management sim: https://togfox.itch.io/horse-stable-manager
https://discord.gg/HeHgwE5nsZ
Re: Gröve: Mini graphics libraries for love2d.
Either this does not work with SLAB (entirely possible) or the example leaves out some key steps. I'm keen to work out which.
resolution module has 8 functions but only one is demonstrated in the wiki. I'm keen to get this to work so I'm happy to help make the doco gud.
- where does .start need to go (inside love.draw?)
- what about .stop?
- what does .toResized do?
- I assume .toGlobal is the opposite.
Maybe these things are obvious and SLAB is messing me up. Hard to say without more info.
resolution module has 8 functions but only one is demonstrated in the wiki. I'm keen to get this to work so I'm happy to help make the doco gud.
- where does .start need to go (inside love.draw?)
- what about .stop?
- what does .toResized do?
- I assume .toGlobal is the opposite.
Maybe these things are obvious and SLAB is messing me up. Hard to say without more info.
Last project:
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
Turn-based PBEM horse stable (racing) management sim: https://togfox.itch.io/horse-stable-manager
https://discord.gg/HeHgwE5nsZ
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
Turn-based PBEM horse stable (racing) management sim: https://togfox.itch.io/horse-stable-manager
https://discord.gg/HeHgwE5nsZ
- FloatingBanana
- Prole
- Posts: 22
- Joined: Sat Mar 02, 2019 4:57 pm
- Contact:
Re: Gröve: Mini graphics libraries for love2d.
I forgot to update the example, sorry about that
When you pass an empty table in the "replace" field, the module modifies your love callbacks and some functions in love.mouse, so you don't have to worry about modifying your existing code. However, this module may be incompatible with other libraries (which was your case), so you can tell the module to not modify anything and let you setup everything manually:
In this way, Slab is ignored by the module. The code above should also clarify your questions.
When you pass an empty table in the "replace" field, the module modifies your love callbacks and some functions in love.mouse, so you don't have to worry about modifying your existing code. However, this module may be incompatible with other libraries (which was your case), so you can tell the module to not modify anything and let you setup everything manually:
Code: Select all
res = require "grove.resolution"
slab = require "slab"
local conf = {
width = 640,
height = 480,
-- Leave the "replace" field empty, so the module won't modify anything.
replace = nil
}
function love.load(args)
res.init(conf)
slab.Initialize(args)
end
function love.draw()
-- Since the "replace" field in the configuration is nil, you need to setup everything manually.
res.start()
-- Put your game drawing operations here.
-- Everything here will be affected by the resolution scaling.
-- In the "manual mode", the mouse position returned from love.mouse.getX() and love.mouse.getY() doesn't match with
-- the screen scaling, so you need to use res.mouse.getX() and res.mouse.Y() to fix this.
love.graphics.circle("fill", res.mouse.getX(), res.mouse.getY(), 10)
res.stop()
-- Everything after res.stop() won't be affected by the resolution scaling
slab.Draw()
end
function love.update(dt)
slab.Update(dt)
end
function love.mousepressed(x, y)
-- The original position doesn't match with the screen scaling, so you need to use res.toScaled to fix this.
x, y = res.toScaled(x, y)
end
Code: Select all
if anyMistake(self.english) then
print("Sorry, english is not my first language")
end
Re: Gröve: Mini graphics libraries for love2d.
Cool resolution scaling!
My boat driving game demo: https://dusoft.itch.io/captain-bradley- ... itius-demo
Who is online
Users browsing this forum: No registered users and 4 guests