Page 11 of 14

Re: GOOi, an Android-Oriented GUI Library

Posted: Fri Aug 25, 2017 3:17 pm
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

Re: GOOi, an Android-Oriented GUI Library

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

Re: GOOi, an Android-Oriented GUI Library

Posted: Mon Sep 04, 2017 2:54 pm
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.

Re: GOOi, an Android-Oriented GUI Library

Posted: Tue Sep 05, 2017 12:22 pm
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 612 times

Re: GOOi, an Android-Oriented GUI Library

Posted: Tue Sep 05, 2017 2:50 pm
by alberto_lara
you're welcome, glad you like it!

Re: GOOi, an Android-Oriented GUI Library

Posted: Wed Sep 06, 2017 11:01 pm
by alberto_lara
Just to let you know, version 0.0.5 is now up! not a lot of changes, just a few

Re: GOOi, an Android-Oriented GUI Library

Posted: Mon Sep 11, 2017 11:44 am
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?

Re: GOOi, an Android-Oriented GUI Library

Posted: Thu Sep 14, 2017 2:52 pm
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.

Re: GOOi, an Android-Oriented GUI Library

Posted: Thu Sep 14, 2017 6:48 pm
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!)

Re: GOOi, an Android-Oriented GUI Library

Posted: Fri Sep 15, 2017 3:09 pm
by alberto_lara
Thanks for the .love :)