Please show us the "modified" gooi.pressed()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 ?
GOOi, an Android-Oriented GUI Library
- yetneverdone
- Party member
- Posts: 448
- Joined: Sat Sep 24, 2016 11:20 am
- Contact:
Re: GOOi, an Android-Oriented GUI Library
My GameDev Website
Going Home:A Pixelated Horror Game
My Repositories!
Follow me lovingly!
Nga pala, pinoy ako.
Going Home:A Pixelated Horror Game
My Repositories!
Follow me lovingly!
Nga pala, pinoy ako.
- alberto_lara
- Party member
- Posts: 372
- Joined: Wed Oct 30, 2013 8:59 pm
Re: GOOi, an Android-Oriented GUI Library
Yes, a .love showing the problem should be enough
Re: GOOi, an Android-Oriented GUI Library
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
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 547 times
- alberto_lara
- Party member
- Posts: 372
- Joined: Wed Oct 30, 2013 8:59 pm
Re: GOOi, an Android-Oriented GUI Library
Hey, thanks for the file. I made it work just by adding this 2 lines in component.lua:
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.
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
EDIT: I first added a fresh copy of GOOi and then made the modifications above.
- alberto_lara
- Party member
- Posts: 372
- Joined: Wed Oct 30, 2013 8:59 pm
Re: GÖÖi, an Android-Oriented GUI Library
It's possible now with the new Joystick:setDigital() functionExtraTerrestrial 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!
Re: GÖÖi, an Android-Oriented GUI Library
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?
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?
- alberto_lara
- Party member
- Posts: 372
- Joined: Wed Oct 30, 2013 8:59 pm
Re: GOOi, an Android-Oriented GUI Library
@dmalves,
EDIT: Can you post a .love file so maybe I can help you? Thanks.
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.Anyway, the problem seams to be that GOOi GUI get scaled but it doesn't get the proper mouse position
EDIT: Can you post a .love file so maybe I can help you? Thanks.
Re: GOOi, an Android-Oriented GUI Library
Is it possible to delete some existing items instead of hiding em?
- alberto_lara
- Party member
- Posts: 372
- Joined: Wed Oct 30, 2013 8:59 pm
Re: GOOi, an Android-Oriented GUI Library
Yes, use
Code: Select all
gooi.removeComponent(component)
-
- Prole
- Posts: 9
- Joined: Wed Aug 16, 2017 9:56 pm
Re: GOOi, an Android-Oriented GUI Library
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:
And I have a button, which should save the content of the text field to ~/.local/share/love/ (I am on linux.):
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!
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!")
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)
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!
Who is online
Users browsing this forum: No registered users and 11 guests