GOOi, an Android-Oriented GUI Library

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
xopxe
Prole
Posts: 4
Joined: Fri Apr 22, 2016 3:49 am

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

Post by xopxe » Sun May 01, 2016 3:51 pm

Is it possible / will it be possible to have vertical sliders?

User avatar
alberto_lara
Party member
Posts: 331
Joined: Wed Oct 30, 2013 8:59 pm

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

Post by alberto_lara » Sun May 01, 2016 4:40 pm

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
}
Last edited by alberto_lara on Fri May 27, 2016 5:10 pm, edited 1 time in total.
LÖVE Projects: GOOi, Süsse and Katsudö
Thank you for taking the time to read this

User avatar
alberto_lara
Party member
Posts: 331
Joined: Wed Oct 30, 2013 8:59 pm

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

Post by alberto_lara » Sun May 01, 2016 4:51 pm

xopxe wrote:Is it possible / will it be possible to have vertical sliders?
Sure, let me add it to the list :)
LÖVE Projects: GOOi, Süsse and Katsudö
Thank you for taking the time to read this

User avatar
alberto_lara
Party member
Posts: 331
Joined: Wed Oct 30, 2013 8:59 pm

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

Post by alberto_lara » Thu May 05, 2016 4:04 pm

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])
LÖVE Projects: GOOi, Süsse and Katsudö
Thank you for taking the time to read this

User avatar
whitebear
Citizen
Posts: 86
Joined: Sun Mar 15, 2009 1:50 am

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

Post by whitebear » Sat May 07, 2016 7:36 pm

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)

User avatar
alberto_lara
Party member
Posts: 331
Joined: Wed Oct 30, 2013 8:59 pm

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

Post by alberto_lara » Wed May 11, 2016 5:58 pm

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
LÖVE Projects: GOOi, Süsse and Katsudö
Thank you for taking the time to read this

User avatar
alberto_lara
Party member
Posts: 331
Joined: Wed Oct 30, 2013 8:59 pm

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

Post by alberto_lara » Thu May 26, 2016 12:53 am

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.
LÖVE Projects: GOOi, Süsse and Katsudö
Thank you for taking the time to read this

User avatar
farvardin
Party member
Posts: 162
Joined: Sat Jun 28, 2008 6:46 pm

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

Post by farvardin » Wed Jun 08, 2016 7:04 pm

thanks a lot for this conveniant library!

User avatar
LordSeaworth
Prole
Posts: 22
Joined: Tue Jun 07, 2016 10:29 pm

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

Post by LordSeaworth » Wed Jun 08, 2016 10:33 pm

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?

User avatar
alberto_lara
Party member
Posts: 331
Joined: Wed Oct 30, 2013 8:59 pm

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

Post by alberto_lara » Thu Jun 09, 2016 3:52 pm

You're welcome, and yes, GÖÖi works in LÖVE 0.10.1 and in desktop environments.
LÖVE Projects: GOOi, Süsse and Katsudö
Thank you for taking the time to read this

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests