GOOi, an Android-Oriented GUI Library

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
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 » Thu Jun 09, 2016 8:17 pm

alberto_lara wrote:You're welcome, and yes, GÖÖi works in LÖVE 0.10.1 and in desktop environments.
Thanks mate. Prolly gonne use this lib. or atleast test it out first.
Nice work

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

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

Post by alberto_lara » Thu Jun 16, 2016 5:40 pm

Hi, new widget: modals!

Image
Code:

Code: Select all

gooi.alert("The background has changed!")
Image
Code:

Code: Select all

gooi.confirm("Change background?", function()
	gr.setBackgroundColor(r2(), r2(), r2())
end)
I'm going to update the repo in a few hours.

lvtalpo
Prole
Posts: 2
Joined: Fri Jun 17, 2016 1:09 am

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

Post by lvtalpo » Fri Jun 17, 2016 1:18 am

Hi, thanks for the great library.

Is there any way to change icons in buttons & labels after creation?

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

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

Post by alberto_lara » Fri Jun 17, 2016 3:53 pm

Yes, there's a function setIcon(Image|string), you can set the icon as a property:

Code: Select all

gooi.newButton({icon = "icon.png"})
chain:

Code: Select all

gooi.newButton("button"):setIcon("icon.png")
or separated:

Code: Select all

btn = gooi.newButton()
btn:setIcon("icon.png")
EDIT: I've just updated the repo.
Last edited by alberto_lara on Mon Jun 20, 2016 4:05 pm, edited 1 time in total.

DIEHARD25
Prole
Posts: 6
Joined: Wed Jul 27, 2016 7:53 am

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

Post by DIEHARD25 » Fri Jul 29, 2016 12:17 pm

Hello there)

Best GUI lib i've found for LOVE) Huge work, my best regards!

Some stupid question - can i make a button in already created grid always enabled after press? Fount some sort of using (setEnabled()), it works, but works always (i can't press already pressed button:))

Thanks for reading and for great tool)

Best regards, Konstantin

Germanunkol
Party member
Posts: 710
Joined: Fri Jun 22, 2012 4:54 pm
Contact:

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

Post by Germanunkol » Mon Aug 01, 2016 2:25 pm

Is there a function which tells me if the mouse is hovering over _any_ gooi element? If not, can you add one?
I want to pass on a click to the level only if it doesn't hit a UI element...
trAInsported - Write AI to control your trains
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de

User avatar
qubodup
Inner party member
Posts: 775
Joined: Sat Jun 21, 2008 9:21 pm
Location: Berlin, Germany
Contact:

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

Post by qubodup » Tue Aug 02, 2016 9:31 pm


https://www.youtube.com/watch?v=xhJ0Ljx2KDM

Just made an updated video of this gooey stuff. Gotta love the drag-cat.
lg.newImage("cat.png") -- made possible by lg = love.graphics
-- Don't force fullscreen (it frustrates those who want to try your game real quick) -- Develop for 1280x720 (so people can make HD videos)

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

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

Post by alberto_lara » Tue Aug 09, 2016 5:43 pm

Hey, sorry for the delay.
Some stupid question - can i make a button in already created grid always enabled after press? Fount some sort of using (setEnabled()), it works, but works always (i can't press already pressed button:))
I'm not sure what you're asking, can you please repeat that? :)

About the "hover" function, yes, therer's one:

Code: Select all

overIt()
if you create, let's say, a radio button, you can use it like this:

Code: Select all

if theRadioBtn:overIt() then
    --do stuff
end
And finally, thanks for the video!

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

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

Post by alberto_lara » Wed Aug 24, 2016 9:13 pm

Hi, I added canvas support for GÖÖi, now you can make something like this:

Code: Select all

function love.load()
   canvas = love.graphics.newCanvas(320, 240)
   gooi.setCanvas(canvas)
   gooi.newButton("A button")
end
function love.update(dt)
   gooi.update(dt)
end
function love.draw()
   love.graphics.setCanvas(canvas)
   -- Draw you canvas stuff
   love.graphics.setCanvas()
   -- Draw gooi in the same canvas:
   gooi.draw()
end
So just 2 drawing operations are performed, the ones you make for your game canvas, and the one which draws the entire GÖÖi, in the example below I draw a scaled canvas/window and GÖÖi works with no problems (the changes in code were precisely to achieve this):

Image
demoCanvas.love
(131.66 KiB) Downloaded 95 times
EDIT: Not tested in Android yet, I'm checking that

EDIT 2: It had some problems with Android, they're mostly fixed except for some weird sharp turns in some analog components, I'm going to check that out too, in the meantime, as a workaround (to avoid these imperfections) you could use these funcions in Android:

Code: Select all

function love.mousepressed(x, y, button)  gooi.pressed() end
function love.mousereleased(x, y, button) gooi.released() end
instead of these ones:

Code: Select all

function love.touchpressed(id, x, y)  gooi.pressed(id, x, y) end
	function love.touchreleased(id, x, y) gooi.released(id, x, y) end
	function love.touchmoved(id, x, y)    gooi.moved(id, x, y) end
this removes multitouch support but at least it'll work fully ok.

EDIT 3: Just uploaded a small change which seems to fix the last issue mentioned, thanks for your feedback!

User avatar
pgimeno
Party member
Posts: 2310
Joined: Sun Oct 18, 2015 2:58 pm

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

Post by pgimeno » Thu Aug 25, 2016 12:05 am

alberto_lara wrote:

Code: Select all

function love.draw()
   love.graphics.setCanvas(canvas)
   -- Draw you canvas stuff
   love.graphics.setCanvas()
   -- Draw gooi in the same canvas:
   gooi.draw()
end
I'm guessing this is a typo? Shouldn't the above be like this or am I misunderstanding something?

Code: Select all

function love.draw()
   love.graphics.setCanvas(canvas)
   -- Draw you canvas stuff
   -- Draw gooi in the same canvas:
   gooi.draw()
   love.graphics.setCanvas()
end

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests