2013.2076 Widgets 2.0 Button issues with setFillColor

Hi Renato,

The “b” in your code is a table of various objects that make up the button, so you can’t fill it directly. Are you attempting to set the label color post-declaration? 

Thanks,

Brent

Hi Brent.

No, I am trying to change the background color of the button (That on last time, it was filling the label also). That command used to work before…

Danny had taught me that while ago (http://forums.coronalabs.com/topic/32943-change-widget-button-background-color/).

Hi Renato,

What kind of button are you seeking to make? An iOS7 style? Of course those don’t have backgrounds. Or, are you trying to “tint” an image used for a button?

Brent

I am using the former iOS theme…

widget.setTheme( "widget\_theme\_ios" )

Just want to fill it with a color different than the default gray.

When Graphics 2.0 was released setFillColor worked fine to fill the button background.

Then, it started filling not only the background but also the label (the first post of this thread).

Now, setFillColor does not work at all.

Are you going for an iOS6 style button? The one with the “button look” ?

Yes, I use them inside a game (image attached).

I think that the iOS 7 button style does not provide a good UI to use inside games.

The default iOS 6 button is great because it is a simply way to create a regular button with Corona without having to have a button image.

Still no way to use setFillColor to re-tint a 9-Slice button right?

Using :setFillColor() on 9-slice buttons is fixed in build #2295 (or perhaps one build earlier).

Just as I gave up and make 6 different colors of my button… Oh well. Better late than never. :slight_smile:

Thanks much!!!

Just tested here (build 2289) and it is working. Thanks Brent.

You can close my bug report about that (#31816 from 4/4/14)

Just tested here the fillColor and now it is not working one more, not even the background is being filled…

This code below worked on build 2162 but now not works any more.

local widget = require "widget" widget.setTheme( "widget\_theme\_ios" ) local b = widget.newButton{ label="Red Button" } b:setFillColor(1,0,0)

Hi Renato,

The “b” in your code is a table of various objects that make up the button, so you can’t fill it directly. Are you attempting to set the label color post-declaration? 

Thanks,

Brent

Hi Brent.

No, I am trying to change the background color of the button (That on last time, it was filling the label also). That command used to work before…

Danny had taught me that while ago (http://forums.coronalabs.com/topic/32943-change-widget-button-background-color/).

Hi Renato,

What kind of button are you seeking to make? An iOS7 style? Of course those don’t have backgrounds. Or, are you trying to “tint” an image used for a button?

Brent

I am using the former iOS theme…

widget.setTheme( "widget\_theme\_ios" )

Just want to fill it with a color different than the default gray.

When Graphics 2.0 was released setFillColor worked fine to fill the button background.

Then, it started filling not only the background but also the label (the first post of this thread).

Now, setFillColor does not work at all.

Are you going for an iOS6 style button? The one with the “button look” ?

Yes, I use them inside a game (image attached).

I think that the iOS 7 button style does not provide a good UI to use inside games.

The default iOS 6 button is great because it is a simply way to create a regular button with Corona without having to have a button image.

Still no way to use setFillColor to re-tint a 9-Slice button right?

Using :setFillColor() on 9-slice buttons is fixed in build #2295 (or perhaps one build earlier).

Just as I gave up and make 6 different colors of my button… Oh well. Better late than never. :slight_smile:

Thanks much!!!