GUI library with non-mouse navigation?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
GUI library with non-mouse navigation?
I want to add gamepad support to the game I'm making for the October Challenge, and I've run into a bit of a problem: the GUI library I'm using (gspot) doesn't support non-mouse navigation. Does anybody know of a GUI library that supports non-mouse navigation? I've yet to find one, and I'm trying to avoid reinventing the wheel.
Where's my big, fat hammock time?
I should pimp my neglected game dev blog.
I should pimp my neglected game dev blog.
- Roland_Yonaba
- Inner party member
- Posts: 1563
- Joined: Tue Jun 21, 2011 6:08 pm
- Location: Ouagadougou (Burkina Faso)
- Contact:
Re: GUI library with non-mouse navigation?
If by "non-mouse navigation" you meant being able to cycle though GUI items (buttons, inputs, etc...) using keyboard or/joysticks,
I don't think there's such a Gui lib.
But, you can still pick one of the existing GUis (or stick with Gspöt), require it, and add that feature by yourself.
I don't think there's such a Gui lib.
But, you can still pick one of the existing GUis (or stick with Gspöt), require it, and add that feature by yourself.
Re: GUI library with non-mouse navigation?
you are looking for a complete GUI?
or only basic controls to use in menu and options?
or only basic controls to use in menu and options?
Bartoleo
Re: GUI library with non-mouse navigation?
Quickie allows keyboard navigation. Because there is still no documentation, here is a shortened example taken from Spaceout. Cycling order is defined by order of appearance of the widgets.
For joystick navigation, simply call gui.keyboard.pressed(key, code) in love.joystickpressed.
Edit: just updated quickie to include gui.mouse.disable()
Code: Select all
function st:init()
gui.keyboard.cycle.prev = {key = 'up'}
gui.keyboard.cycle.next = {key = 'down'}
gui.mouse.disable()
end
function st:update(dt)
love.graphics.setFont(Font.slkscr[40])
gui.group.push{grow = "down", size = {400,40}, spacing = 5, pos = {(W-400)/2, H-230}}
if not show_credits then
if gui.Button{text = "Start"} then
tween(1, fade_color, {0,0,0,255}, 'linear', function() GS.switch(State.game) end)
end
if gui.Button{text = "Highscores"} then
tween(1, fade_color, {0,0,0,255}, 'linear', function() GS.switch(State.highscores) end)
end
if gui.Button{text = "Credits"} then
show_credits = true
end
if gui.Button{text = "Exit"} then
love.event.push("quit")
end
else
-- omitted: credits
if gui.Button{text = "Back"} then
show_credits = false
gui.keyboard.clearFocus() -- necessary so we highlight <Start> when going back
end
end
gui.group.pop{}
end
function st:draw()
-- stuff
gui.core.draw()
-- more stuff
end
function st:keypressed(key, code)
-- propagate keyboard events to quickie
return gui.keyboard.pressed(key, code)
end
Edit: just updated quickie to include gui.mouse.disable()
Re: GUI library with non-mouse navigation?
maybe MinimalMenu? viewtopic.php?f=5&t=11199
Re: GUI library with non-mouse navigation?
Thanks for the suggestions. I think I'll just go with vrld's suggestion for now and use Quickie. It has automatic layouts, which will be absurdly useful. If I have time (which seems to be an increasingly large if), I may try to make my own tiny GUI library.
Where's my big, fat hammock time?
I should pimp my neglected game dev blog.
I should pimp my neglected game dev blog.
- josefnpat
- Inner party member
- Posts: 955
- Joined: Wed Oct 05, 2011 1:36 am
- Location: your basement
- Contact:
Re: GUI library with non-mouse navigation?
You can also check out my LoveMenu if you like, but there isn't any documentation.
Missing Sentinel Software | Twitter
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
Who is online
Users browsing this forum: Google [Bot], Semrush [Bot] and 1 guest