## GOOi, an Android-Oriented GUI Library

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

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

modiX wrote:
Sat Feb 24, 2018 8:34 pm
When you have any greater texture behind it, it might make more sense to simply put the background transparent and add some semi-transparent effect for clicking and such.
I see, you mean something to give the impression it's being clicked, right?
LÖVE Projects: GOOi, Süsse and Katsudö
Thank you for taking the time to read this

Marty
Citizen
Posts: 89
Joined: Mon Dec 04, 2017 1:47 am
Location: Germany

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

alberto_lara wrote:
Sun Feb 25, 2018 4:57 am
I see, you mean something to give the impression it's being clicked, right?
Yes.

Basically I have a complicated background. Maybe I designed a full window with nice texture that is in the background of my form. Your controls on my form should be able to be 100% transparent if I want to. Or I want the buttons only to be bordered and the rest is transparent so I see the background of my form. Since my buttons are re-arranged based on the resolution, I cannot simply design the whole button, but I need to be able to see the background texture through it. I haven't tested it, but I think putting a transparent image should already suit my needs.

Now what would be very helpful is to set a different image when the user is clicking / interacting with the control. Maybe I want to overlay some shadows or some white semi transparent film to the surface of the button. This would make your lib an allrounder when it comes to GUI on LÖVE.

I'm very exited to try your lib this week when everything works like expected on my end.

Keep up that good work!

───▄▀▀▀▄▄▄▄▄▄▄▀▀▀▄───
───█▒▒░░░░░░░░░▒▒█───
────█░░░░░░░░░█────
▄▄──█░░░▀█▀░░░█──▄▄
█░░█▀▄░░░░░░░▄▀█░░█

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

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

I see, well, you may want to see gooi.glass(), gooi.mode3d() and gooi.shadow() if you want to see different styles in action. For transparency, you just have to set bgColor like {255, 0, 0, 127}, for instance (for a red transparent color). If you want a totally transparent background with a solid border then just play with the corresponding properties.

As for the image set with :setBGImage(), there's not way of setting transparency for that, but there should be, I could add that functionality on the next version of GOOi (or you could add a PR for that )
LÖVE Projects: GOOi, Süsse and Katsudö
Thank you for taking the time to read this

Marty
Citizen
Posts: 89
Joined: Mon Dec 04, 2017 1:47 am
Location: Germany

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

alberto_lara wrote:
Mon Feb 26, 2018 4:48 pm
I see, well, you may want to see gooi.glass(), gooi.mode3d() and gooi.shadow() if you want to see different styles in action. For transparency, you just have to set bgColor like {255, 0, 0, 127}, for instance (for a red transparent color). If you want a totally transparent background with a solid border then just play with the corresponding properties.

As for the image set with :setBGImage(), there's not way of setting transparency for that, but there should be, I could add that functionality on the next version of GOOi (or you could add a PR for that )
Thank you very much, I will look into such functions.

However, I just noticed that your lib is using a global variable called "component". This is a bit of goof for me, since I'm using a global variable component for accessing my ECS-components.

In my opinion any library should be nested in one global variable, which is "gooi" in this case. Now I could require the lib into a variable, but this will break, because you access your global variables from your code, everywhere. It's not just component, but even layout, label, slider, etc. Requiring those to be globally accessible sounds bad by design, because you'd have no idea with what you might name-conflict, and thus, easy implementation is not ensured, anymore.

It would be great if you could overthink the API of gooi, so you end up with only one global variable, called gooi?

EDIT: Also, please check out this design:

Its buttons are designed with 3 segments. The left and the right segment is for the each side (left/right) of the button. The middle segment of the texture is for all the space between the other two segments. So this part gets repeated on the x axis.

I could not find a way to build buttons like this. Is this possible? After trying a little I can clearly see that you stretch the image to fit the content. However on low res images this does not look good. I'd love to know how I can change that.

Overall I love the idea of your grid system, but I miss more features like independent padding in any cell of the grid, or did I miss it?
Also, how can I change the background of a button when it's getting clicked?

───▄▀▀▀▄▄▄▄▄▄▄▀▀▀▄───
───█▒▒░░░░░░░░░▒▒█───
────█░░░░░░░░░█────
▄▄──█░░░▀█▀░░░█──▄▄
█░░█▀▄░░░░░░░▄▀█░░█

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

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

I could not find a way to build buttons like this. Is this possible?
not really, but this could be added in future versions of GOOi, please feel free to make a PR or a feature request.
but I miss more features like independent padding in any cell of the grid, or did I miss it?
No independent padding either (this is easier to implement than the button thing though)
how can I change the background of a button when it's getting clicked?
you can use the onPress() and onRelease() callbacks (not really practical but it's how it can be done right now):

Code: Select all

btn = gooi.newButton({text = "my button"})
:onPress(function(c) c:bg(alternativeColor); end)
:onRelease(function(c) c:bg(initialColor); end)
EDIT: about the global variables thing, you're totally right, I'll have to change a few code for that.
LÖVE Projects: GOOi, Süsse and Katsudö
Thank you for taking the time to read this

yetneverdone
Party member
Posts: 351
Joined: Sat Sep 24, 2016 11:20 am
Contact:

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

Panels (grids) should have the setting to draw outer border
In modals confirm, allow texts "okay" and "cancel" be modifiable, or just provide a way to make dialogue box.
Panel:add should allow in what col and row it be set into.

yintercept
Citizen
Posts: 61
Joined: Mon Apr 02, 2018 3:31 pm

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

Theres a *tiny* pull request waiting on github that allows users to specify the y positioning of text on a button.

Do you have any other small code tweaks/chores you'd be willing to farm out?
Apparently I'm a fan of most people.

Or maybe LOVE devs are just that good.

memzen
Prole
Posts: 5
Joined: Fri May 11, 2018 7:50 am

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

I worked on updating Gooi with the color range changes in Love 11. The colors are better but not 100%. Get here:

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

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

Hey everyone, sorry for the delay, it's been some crazy times in the office.
In modals confirm, allow texts "okay" and "cancel" be modifiable, or just provide a way to make dialogue box.
I think it's possible to do it, here you can see the code which does that. There's no example (currently) for that in the Wiki, I'll keep it in mind while I fix some stuff here and there (like the lost images). I'll try to have some updates in a few days or a couple of weeks.
LÖVE Projects: GOOi, Süsse and Katsudö
Thank you for taking the time to read this

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

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

Update #1: I've merged this PR (thanks to jmiskovic)

Update #2: Updated images on readme file and Wiki
LÖVE Projects: GOOi, Süsse and Katsudö
Thank you for taking the time to read this

### Who is online

Users browsing this forum: No registered users and 11 guests