Re: GÖÖi, an Android-Oriented GUI Library
Posted: Sun May 01, 2016 3:51 pm
Is it possible / will it be possible to have vertical sliders?
I've just tested with this code and everything seems to work fine:xopxe wrote:You're right, I never get love.touchpressed events... Any idea what can be wrong?
(I'm on Ubuntu 14.04 with gooi from git)
Code: Select all
require "gooi"
function love.load()
gr = love.graphics
ball = {
x = 300,
y = 300,
color = {255, 255, 255},
radius = 50
}
joy = gooi.newJoy({size = 200})
panel = gooi.newPanel(0, 0, gr.getWidth(), gr.getHeight(), "game")
panel:add(joy, "b-l")
panel:add(gooi.newButton({text = "Color", w = 220, h = 70}):onRelease(function()
ball.color = {r(), r(), r()}
end), "b-r")
panel:add(gooi.newButton({text = "Size", w = 220, h = 70}):onRelease(function()
ball.radius = r() / 2
end), "b-r")
end
function love.update(dt)
gooi.update(dt)
ball.x = ball.x + joy:xValue() * 200 * dt
ball.y = ball.y + joy:yValue() * 200 * dt
end
function love.draw()
gooi.draw()
gr.setColor(ball.color)
gr.circle("fill", ball.x, ball.y, ball.radius)
end
function r() return love.math.random(0, 255) end
function love.touchpressed(id, x, y) gooi.pressed(id, x, y) end
function love.touchmoved(id, x, y) gooi.moved(id, x, y) end
function love.touchreleased(id, x, y) gooi.released(id, x, y) end
function love.keypressed(key)
if key == "escape" then
love.event.quit()
end
end
Code: Select all
style= {
font = gr.newFont(fontDir.."ProggySquare.ttf", 16),
fgColor = "#FFFFFF",
bgColor = {22, 99, 140, 240},
mode3d = true -- Or false for plain aspect
}
Sure, let me add it to the listxopxe wrote:Is it possible / will it be possible to have vertical sliders?
A button with multiple states seems like an interesting idea (or a toggle button, which is a basic one I forgot). About the slider, maybe a "range" slider like the ones used in jQuery UI would be something nice:whitebear wrote:I have few ideas for UI elements
First suggestion would be something like this:
Basically line that end-user can manipulate into segments. The "flags" could have simply string label (or dynamic number based where it is.) or colour label.
And my second suggestion would be button matrix with multiple states (not just on/off)