Page 5 of 14

Re: GÖÖi, an Android-Oriented GUI Library

Posted: Sun May 01, 2016 3:51 pm
by xopxe
Is it possible / will it be possible to have vertical sliders?

Re: GÖÖi, an Android-Oriented GUI Library

Posted: Sun May 01, 2016 4:40 pm
by alberto_lara
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)
I've just tested with this code and everything seems to work fine:

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
Please note: This was tested in Android only (GÖÖi it's oriented to this), I don't know how this behaves in touchscreen laptops or other environments.
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:

Image
Image

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
}

Re: GÖÖi, an Android-Oriented GUI Library

Posted: Sun May 01, 2016 4:51 pm
by alberto_lara
xopxe wrote:Is it possible / will it be possible to have vertical sliders?
Sure, let me add it to the list :)

Re: GÖÖi, an Android-Oriented GUI Library

Posted: Thu May 05, 2016 4:04 pm
by alberto_lara
Hi, just a quick update: I've changed spinners to look like this:

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:

Image

just call :setImage([string|Image])

Re: GÖÖi, an Android-Oriented GUI Library

Posted: Sat May 07, 2016 7:36 pm
by whitebear
I have few ideas for UI elements
First suggestion would be something like this:
Image
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)

Re: GÖÖi, an Android-Oriented GUI Library

Posted: Wed May 11, 2016 5:58 pm
by alberto_lara
whitebear wrote:I have few ideas for UI elements
First suggestion would be something like this:
Image
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)
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:

Image

Re: GÖÖi, an Android-Oriented GUI Library

Posted: Thu May 26, 2016 12:53 am
by alberto_lara
Hi, another update regarding GÖÖi looking, I added a glossy effect and I think it looks nice :)

Image

Just add "glass = true" in the style used.

Repo updated as well.

Re: GÖÖi, an Android-Oriented GUI Library

Posted: Wed Jun 08, 2016 7:04 pm
by farvardin
thanks a lot for this conveniant library!

Re: GÖÖi, an Android-Oriented GUI Library

Posted: Wed Jun 08, 2016 10:33 pm
by LordSeaworth
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?

Re: GÖÖi, an Android-Oriented GUI Library

Posted: Thu Jun 09, 2016 3:52 pm
by alberto_lara
You're welcome, and yes, GÖÖi works in LÖVE 0.10.1 and in desktop environments.