## GOOi, an Android-Oriented GUI Library

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

### Re: GOOi, an Android-Oriented GUI Library

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()

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

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

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

### Re: GOOi, an Android-Oriented GUI Library

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

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

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

### Re: GOOi, an Android-Oriented GUI Library

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

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

### Re: GOOi, an Android-Oriented GUI Library

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

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.

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.)

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!

-------------------------------------------------------------------------------------------------------
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?

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

### Re: GOOi, an Android-Oriented GUI Library

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

Thanks for pointing that out!
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

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

### Re: GOOi, an Android-Oriented GUI Library

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

### Who is online

Users browsing this forum: No registered users and 40 guests