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

Re: GOOi, an Android-Oriented GUI Library

Post by alberto_lara » Fri Aug 25, 2017 3:17 pm

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
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 » Tue Aug 29, 2017 3:39 pm

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

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

Re: GOOi, an Android-Oriented GUI Library

Post by alberto_lara » Mon Sep 04, 2017 2:54 pm

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.
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 » Tue Sep 05, 2017 12:22 pm

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

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

Re: GOOi, an Android-Oriented GUI Library

Post by alberto_lara » Tue Sep 05, 2017 2:50 pm

you're welcome, glad you like it!
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: 326
Joined: Wed Oct 30, 2013 8:59 pm

Re: GOOi, an Android-Oriented GUI Library

Post by alberto_lara » Wed Sep 06, 2017 11:01 pm

Just to let you know, version 0.0.5 is now up! not a lot of changes, just a few
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 » Mon Sep 11, 2017 11:44 am

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

Re: GOOi, an Android-Oriented GUI Library

Post by alberto_lara » Thu Sep 14, 2017 2:52 pm

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.
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 » Thu Sep 14, 2017 6:48 pm

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

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

Re: GOOi, an Android-Oriented GUI Library

Post by alberto_lara » Fri Sep 15, 2017 3:09 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests