GOOi, an Android-Oriented GUI Library

Showcase your libraries, tools and other projects that help your fellow love users.
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, sorry for the delay, I'm glad you're enjoying GOOi and and having fun with your son :)

Try using

Code: Select all

:getText()
instead of

Code: Select all

.getText()
(the colon character is the "self" of the object, in this case, a GOOi component). Look at this document to see further on this: https://www.lua.org/pil/16.html
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 your reply!
I will have a close look at the OOP-Chapter in the lua book - but there seem to be more problems.

I enclosed my .love file.
Basically, I am tinkering with your demo code. Here I want to save a line of text, but I do not know how to pass the information from the text field to the saveButton.
When you press the saveButton, you get this error:

Code: Select all

main.lua:32: attempt to call method "getText" (a nil value)
Why can't Love see the string in the text field?
Do I have to add something in the love.update() section?
Attachments
save-textline.love
(259.18 KiB) Downloaded 443 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 »

My bad, the function :getText() didn't exist for text fields, now I added it and updated the repo, please download gooi.lua and replace it in your project, it should work.
BörnedByLOVE
Prole
Posts: 9
Joined: Wed Aug 16, 2017 9:56 pm

Re: GOOi, an Android-Oriented GUI Library

Post by BörnedByLOVE »

Heureka! It works!
You send another little bug to limbo! Thanks for all your good work on GOOi!

I cleaned up the example a bit... So:

Hello LÖVE Beginners and Intermediate Users! (Like me.) Here is a working code snippet demonstrating GOOi's Text Field!
Save-A-Line.love
(259.55 KiB) Downloaded 608 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 »

you're welcome, glad you like it!
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 »

Just to let you know, version 0.0.5 is now up! not a lot of changes, just a few
BörnedByLOVE
Prole
Posts: 9
Joined: Wed Aug 16, 2017 9:56 pm

Re: GOOi, an Android-Oriented GUI Library

Post by BörnedByLOVE »

Hi! Today I have a (noob's) conceptual question concerning different scenes in LÖVE-games and what to do with the GOOi-code for the scenes.

Here is a fragment of an android game which should illustrate my question.

1) Trapped on Planet Evil our hero is steering his ship through a narrow tunnel.
(Don't touch the walls! It will reduce your energy! Avoid those sinister energy bubbles!
Three contacts and you are dead meat.)
If AUTO = autopilot is disabled you control your ship manually with the mouse / touch.
If AUTO is enabled touch controls a weapon, it fires on touch.
Image


2) Hero has made it! But at the end of the tunnel there is the Mighty Gatekeeper, asking his eternal questions...
Choose wisely, Stranger! (Button A, B or C.)
Image


3) Hero did it again! Now all is left to do, is reaching the Space Station.
(Control his ship with the digital joystick.) And you're done!
Image
-------------------------------------------------------------------------------------------------------
Now my questions:

a) How do you construct these three "scenes" in LÖVE? Should they be in different .lua files?
How to switch from one scene to another, or to advance to another?

b) Where would the GOOi code for the different buttons, joysticks... in the different scenes go?
Different .lua files (again) to be required?
Or does the GOOi code has to be clustered in one place? (The love.load callback of the main.lua?)

How can this be done?
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, you can create all the components in love.load(), you need to use Groups to work with this more easily. For instance, you could use a group called "options" for A, B and C and a group "space_station" for the joystick and "home" button.

Check this out too, setGroupEnabled() and setGroupVisible() may be useful.

No need for multiple lua files.
BörnedByLOVE
Prole
Posts: 9
Joined: Wed Aug 16, 2017 9:56 pm

Re: GOOi, an Android-Oriented GUI Library

Post by BörnedByLOVE »

Thanks for pointing that out!
I have to admit, that I overread the groups paragraph...
Now I have a lot to read and experiment with.

Just found your very instructive example on the wiki, made a .love file out of it, so that other people don't miss this and can have a look at the functionality.

By the way: Are you the famous Lara Coding Twins? Alberto on the forums, Gustavo on GitHub? ;)
(Just kiddin', thanx for the good work, as always!)
Attachments
GOOi-groups-at-work.love
(256.67 KiB) Downloaded 462 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 »

Thanks for the .love :)
Post Reply

Who is online

Users browsing this forum: No registered users and 22 guests