GOOi, an Android-Oriented GUI Library

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
yetneverdone
Party member
Posts: 448
Joined: Sat Sep 24, 2016 11:20 am
Contact:

Re: GOOi, an Android-Oriented GUI Library

Post by yetneverdone »

lgktg wrote: Tue May 02, 2017 7:22 am I tried to adapt the librairy to work with cameras (http://nova-fusion.com/2011/04/19/camer ... he-basics/) by modifying gooi.pressed() but i wasn't able to make it work. Any advices ?
Please show us the "modified" gooi.pressed()
User avatar
alberto_lara
Party member
Posts: 372
Joined: Wed Oct 30, 2013 8:59 pm

Re: GOOi, an Android-Oriented GUI Library

Post by alberto_lara »

yetneverdone wrote: Wed May 03, 2017 2:46 am Please show us the "modified" gooi.pressed()
Yes, a .love showing the problem should be enough :)
lgktg
Prole
Posts: 2
Joined: Tue May 02, 2017 7:17 am

Re: GOOi, an Android-Oriented GUI Library

Post by lgktg »

Here is my .love with no modifications on gooi.pressed()

So i tried to replace the love.mouse.getX() and love.mouse.getY() to love.mouse.getX() - camera.x and same for y but i doesn't solve it :(
Attachments
GooiWithCamera.love
(25.68 KiB) Downloaded 538 times
User avatar
alberto_lara
Party member
Posts: 372
Joined: Wed Oct 30, 2013 8:59 pm

Re: GOOi, an Android-Oriented GUI Library

Post by alberto_lara »

Hey, thanks for the file. I made it work just by adding this 2 lines in component.lua:

Code: Select all

	-- Scale:
	if x and y then
		xm, ym = x, y
	end

        xm = xm + camera.x -- this one
        ym = ym + camera.y -- and this one

	local radiusCorner = self.style.radius

	local theX = self.x
	local theY = self.y
the thing is, once you do this, the quit button won't work because this solution can't work with buttons on the camera and outside the camera at the same time, you would need to do some more validations/modifications in GOOi to discern on this. Another option could be to draw all the gui outside the camera and move just the "stars" group when moving the camera, there's a setBounds() method, you can check it here, hope this helps!

EDIT: I first added a fresh copy of GOOi and then made the modifications above.
User avatar
alberto_lara
Party member
Posts: 372
Joined: Wed Oct 30, 2013 8:59 pm

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

Post by alberto_lara »

ExtraTerrestrial wrote: Wed Feb 01, 2017 12:53 am Would a four way directional pad like the plus directional pads on old NES be possible or maybe a setup in game layout where four buttons are arranged like that. Love it by the way thanks!
It's possible now with the new Joystick:setDigital() function
User avatar
dmalves
Prole
Posts: 3
Joined: Thu Aug 25, 2016 10:53 pm

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

Post by dmalves »

I tried to use GOOI with push library https://love2d.org/forums/viewtopic.ph ... on+library
to fix resolution on android, but no sucess :( I would like to know if push library can be used or if there is any other work around to perfectly scale GOOi and still get proper touch screen response. Anyway, the problem seams to be that GOOi GUI get scaled but it doesn't get the proper mouse position. Maybe because it uses love.mouse.getX( ). How can I tell GOOi to use my mouse.getX mouse.getY functions, so that mouse position get scaled as well?
User avatar
alberto_lara
Party member
Posts: 372
Joined: Wed Oct 30, 2013 8:59 pm

Re: GOOi, an Android-Oriented GUI Library

Post by alberto_lara »

@dmalves,
Anyway, the problem seams to be that GOOi GUI get scaled but it doesn't get the proper mouse position
Probably yes, I try to code GOOi so it works "out of the box" in almost any situation, but, since there are a lot of other libs, I can't really test on all of them and see if it works, most of the time you'll need to adjust just a few lines in GOOi's code to combine it with other libraries, sorry for the inconvenient.

EDIT: Can you post a .love file so maybe I can help you? Thanks.
lvtalpo
Prole
Posts: 2
Joined: Fri Jun 17, 2016 1:09 am

Re: GOOi, an Android-Oriented GUI Library

Post by lvtalpo »

Is it possible to delete some existing items instead of hiding em?
User avatar
alberto_lara
Party member
Posts: 372
Joined: Wed Oct 30, 2013 8:59 pm

Re: GOOi, an Android-Oriented GUI Library

Post by alberto_lara »

Yes, use

Code: Select all

gooi.removeComponent(component)
BörnedByLOVE
Prole
Posts: 9
Joined: Wed Aug 16, 2017 9:56 pm

Re: GOOi, an Android-Oriented GUI Library

Post by BörnedByLOVE »

Hello Alberto! - Thank you for this fantastic library! (This is my first post.)
I have done a little with Python over the years. Now my son and me ;) :) try to get into Löve and Lua as a personal holiday project. The attractive thing with Löve is that you can get your stuff on Android mobiles so easily. Impressive! But: No mouse and keyboard on the mobile. So GOOi comes in as the knight in shining armour! With instant touch and buttons and stuff. You are the best.

Okay! At the moment I have a little program where I try to save something from a text field.
I have a text field in the love.load() department:

Code: Select all

txt1 = gooi.newText({y = 60, w = 328, h = 35}):setText("Let's have cookies today!")
And I have a button, which should save the content of the text field to ~/.local/share/love/ (I am on linux.):

Code: Select all

btn2 = gooi.newButton({text = "Save", x = 350, y = 60, w = 80, h = 35}):onRelease(function()
        love.filesystem.setIdentity("MyNewApp5")
        love.filesystem.write("mynote.txt", txt1.getText(), all ) 
    end)
The saving stuff itself works, I tested it with a default string.
But the getText()-function (or method?) does not what I want it to do... ;)
I cannot get the connection between the text field and the save button... Löve complains, that txt1.getText() has a nil value?!?
Could you please help me out? Thanks in advance!
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 3 guests