GOOi, an Android-Oriented GUI Library
Re: GÖÖi, an Android-Oriented GUI Library
Is it possible / will it be possible to have vertical sliders?
- alberto_lara
- Party member
- Posts: 372
- Joined: Wed Oct 30, 2013 8:59 pm
Re: GÖÖi, an Android-Oriented GUI Library
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
gooi.moved() and gooi.update() are necessary (at least in this example), sorry if I forgot to mention it.
Also, I've updated the repo, a "3D mode" was added so you can make GÖÖi to have 2 modes, plain or 3D:
This is set in the style object:
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
}
Last edited by alberto_lara on Fri May 27, 2016 5:10 pm, edited 1 time in total.
- alberto_lara
- Party member
- Posts: 372
- Joined: Wed Oct 30, 2013 8:59 pm
Re: GÖÖi, an Android-Oriented GUI Library
Sure, let me add it to the listxopxe wrote:Is it possible / will it be possible to have vertical sliders?
- alberto_lara
- Party member
- Posts: 372
- Joined: Wed Oct 30, 2013 8:59 pm
Re: GÖÖi, an Android-Oriented GUI Library
Hi, just a quick update: I've changed spinners to look like this:
And now they're much more user-friendly, if you touch/click it in the left half, the value decreases and the same for the half on the right. So you don't necessarily need to touch the arrows.
EDIT: Also, joysticks support now an image as stick:
just call :setImage([string|Image])
And now they're much more user-friendly, if you touch/click it in the left half, the value decreases and the same for the half on the right. So you don't necessarily need to touch the arrows.
EDIT: Also, joysticks support now an image as stick:
just call :setImage([string|Image])
Re: GÖÖi, an Android-Oriented GUI Library
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)
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)
- alberto_lara
- Party member
- Posts: 372
- Joined: Wed Oct 30, 2013 8:59 pm
Re: GÖÖi, an Android-Oriented GUI Library
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)
- alberto_lara
- Party member
- Posts: 372
- Joined: Wed Oct 30, 2013 8:59 pm
Re: GÖÖi, an Android-Oriented GUI Library
Hi, another update regarding GÖÖi looking, I added a glossy effect and I think it looks nice
Just add "glass = true" in the style used.
Repo updated as well.
Just add "glass = true" in the style used.
Repo updated as well.
Re: GÖÖi, an Android-Oriented GUI Library
thanks a lot for this conveniant library!
- LordSeaworth
- Prole
- Posts: 22
- Joined: Tue Jun 07, 2016 10:29 pm
Re: GÖÖi, an Android-Oriented GUI Library
Just saw this thread.
Is this lib compatible with latest löve and with pc support? With pc support i mean just using the lib in a non android löve2d game?
Is this lib compatible with latest löve and with pc support? With pc support i mean just using the lib in a non android löve2d game?
- alberto_lara
- Party member
- Posts: 372
- Joined: Wed Oct 30, 2013 8:59 pm
Re: GÖÖi, an Android-Oriented GUI Library
You're welcome, and yes, GÖÖi works in LÖVE 0.10.1 and in desktop environments.
Who is online
Users browsing this forum: Google [Bot] and 2 guests