equivilant of object:setLabel() for other widgent.newButton parameters

Is there a way to use something similar to object:setLabel()  to change the labelColor = ? I would like to be able to change more than just the text.

What I would really like to do is change the defaultFile =, but if I can do the Text Color then I could move on.

This way widget buttons truly could have visual ‘states’

Hi @Lava Level,

There’s not a built-in function for changing the label color post-declaration, but you can dig down to the object and change its color manually, like so:

[lua]

myButton._view._label:setFillColor(0,1,0)

[/lua]

Hope this helps,

Brent

ok, thanks. I just made a newRoundedRect to appear behind the selected. looks nice. I’ll try changing the color that way too.

Ok. got it. I have to look up all this ._view. functionality!!! awesome thanks!

Hi @Lava Level,

Are you creating your own roundedRect object to become the button base? You might have missed my note on this, but it’s possible now to create shape-based buttons as of a recent daily build. Here’s the documentation on it:

http://docs.coronalabs.com/daily/api/library/widget/newButton.html

Brent

Oh wow! Those are really nice!  

Actually since my buttons are images, and I drop their labels right below them, making the roundedRect slightly bigger than the button highlights both the button and the text below it really nicely. (since that text expands the buttons bounds)

I am really liking these buttons. And I am sure I am going to now proto at least with those cool shape-based buttons!!

really liking Widgets2.0 and Gr.2.0 !!!

One thing I noticed, my buttons feel a little sticky when I put them in a scroll view though? Or am I doing it wrong?

Hi Lava Level,

Thanks for the feedback. The buttons shouldn’t necessarily be “sticky” inside a scrollView. According to the document I linked you to, which of the 3 listener types are you using? onPress, onRelease, or onEvent? Inside a scrollView, some widgets behave a slight bit differently because the scrollView typically needs to “regain control” of the input outside (behind) an overlaying widget. But for buttons, this shouldn’t be too much of an issue… I’m testing in the example project now, and they seem to be responsive inside the scrollView.

Best regards,

Brent

Oh ok, great. I’m using onRelease. Yeah when I meant sticky I meant the scrolling. If anything it is more of a design issue for me and how much buttons I was stuffing into scrollviews. 

Hi @Lava Level,

There’s not a built-in function for changing the label color post-declaration, but you can dig down to the object and change its color manually, like so:

[lua]

myButton._view._label:setFillColor(0,1,0)

[/lua]

Hope this helps,

Brent

ok, thanks. I just made a newRoundedRect to appear behind the selected. looks nice. I’ll try changing the color that way too.

Ok. got it. I have to look up all this ._view. functionality!!! awesome thanks!

Hi @Lava Level,

Are you creating your own roundedRect object to become the button base? You might have missed my note on this, but it’s possible now to create shape-based buttons as of a recent daily build. Here’s the documentation on it:

http://docs.coronalabs.com/daily/api/library/widget/newButton.html

Brent

Oh wow! Those are really nice!  

Actually since my buttons are images, and I drop their labels right below them, making the roundedRect slightly bigger than the button highlights both the button and the text below it really nicely. (since that text expands the buttons bounds)

I am really liking these buttons. And I am sure I am going to now proto at least with those cool shape-based buttons!!

really liking Widgets2.0 and Gr.2.0 !!!

One thing I noticed, my buttons feel a little sticky when I put them in a scroll view though? Or am I doing it wrong?

Hi Lava Level,

Thanks for the feedback. The buttons shouldn’t necessarily be “sticky” inside a scrollView. According to the document I linked you to, which of the 3 listener types are you using? onPress, onRelease, or onEvent? Inside a scrollView, some widgets behave a slight bit differently because the scrollView typically needs to “regain control” of the input outside (behind) an overlaying widget. But for buttons, this shouldn’t be too much of an issue… I’m testing in the example project now, and they seem to be responsive inside the scrollView.

Best regards,

Brent

Oh ok, great. I’m using onRelease. Yeah when I meant sticky I meant the scrolling. If anything it is more of a design issue for me and how much buttons I was stuffing into scrollviews.