Page 10 of 14
Re: GOOi, an Android-Oriented GUI Library
Posted: Wed May 03, 2017 2:46 am
by yetneverdone
Please show us the "modified" gooi.pressed()
Re: GOOi, an Android-Oriented GUI Library
Posted: Wed May 03, 2017 2:55 pm
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
Re: GOOi, an Android-Oriented GUI Library
Posted: Thu May 04, 2017 11:44 am
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
Re: GOOi, an Android-Oriented GUI Library
Posted: Fri May 05, 2017 4:04 pm
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.
Re: GÖÖi, an Android-Oriented GUI Library
Posted: Sat May 13, 2017 4:43 am
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
Re: GÖÖi, an Android-Oriented GUI Library
Posted: Wed Jun 28, 2017 1:11 pm
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?
Re: GOOi, an Android-Oriented GUI Library
Posted: Wed Jun 28, 2017 9:15 pm
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.
Re: GOOi, an Android-Oriented GUI Library
Posted: Fri Aug 04, 2017 7:31 am
by lvtalpo
Is it possible to delete some existing items instead of hiding em?
Re: GOOi, an Android-Oriented GUI Library
Posted: Thu Aug 10, 2017 3:27 am
by alberto_lara
Re: GOOi, an Android-Oriented GUI Library
Posted: Wed Aug 16, 2017 10:35 pm
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!