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: 302
Joined: Sat Sep 24, 2016 11:20 am
Contact:

Re: GOOi, an Android-Oriented GUI Library

Post by yetneverdone » Wed May 03, 2017 2:46 am

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: 327
Joined: Wed Oct 30, 2013 8:59 pm

Re: GOOi, an Android-Oriented GUI Library

Post by alberto_lara » Wed May 03, 2017 2:55 pm

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

lgktg
Prole
Posts: 2
Joined: Tue May 02, 2017 7:17 am

Re: GOOi, an Android-Oriented GUI Library

Post by lgktg » Thu May 04, 2017 11:44 am

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 81 times

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

Re: GOOi, an Android-Oriented GUI Library

Post by alberto_lara » Fri May 05, 2017 4:04 pm

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

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

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

Post by alberto_lara » Sat May 13, 2017 4:43 am

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

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 » Wed Jun 28, 2017 1:11 pm

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: 327
Joined: Wed Oct 30, 2013 8:59 pm

Re: GOOi, an Android-Oriented GUI Library

Post by alberto_lara » Wed Jun 28, 2017 9:15 pm

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

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

Re: GOOi, an Android-Oriented GUI Library

Post by lvtalpo » Fri Aug 04, 2017 7:31 am

Is it possible to delete some existing items instead of hiding em?

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

Re: GOOi, an Android-Oriented GUI Library

Post by alberto_lara » Thu Aug 10, 2017 3:27 am

Yes, use

Code: Select all

gooi.removeComponent(component)
LÖVE Projects: GOOi, Süsse, Dyzön and Katsudö
Thanks for taking the time and read this

BörnedByLOVE
Prole
Posts: 9
Joined: Wed Aug 16, 2017 9:56 pm

Re: GOOi, an Android-Oriented GUI Library

Post by BörnedByLOVE » Wed Aug 16, 2017 10:35 pm

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: No registered users and 4 guests