widget.newButton > Label > Alpha Opacity

I have this settings of labelColor = { default={ 1, 1, 1,1 }, over={ 1, 1, 1, 1 } },

But when I am pressing button alpha is changed could you help me, please?

labelColor only affects the text label of the button, not the button color.

Yes, you are right. I made me mistake in my explanation.

I mean text label changes alpha.

vanya, 

What are the other button parameters? The labelColor settings you posted should not change the text alpha. Must be something else going on.

local buttonEvent = widget.newButton

{

   sheet = buttonsSheet,

   defaultFrame = 2,

   overFrame = 1,

   fontSize  = 40,

   labelColor = { default={ 1, 1, 1,1 }, over={ 1, 1, 1, 1 } },

   label = “SPECIAL EVENT”,

   id = “event”,

   onEvent = handleButton

}

function handleButton  is empty.

To change the colour of the button and not the label text you want to set the fillColor property:

http://docs.coronalabs.com/daily/api/library/widget/newButton.html#fillcolor-optional

May be my explanation is awfull.

Thats why i attached screenshot bellow.

1 button is normall. 2 is pressed.

Why label of 1 and 2 button is different?

Hi @vanya.levchenko,

I think this is because there’s a “hidden” property of the widget button which makes the label fade in alpha on press. This is a borderline “bug” and I’m going to check into fixing it, or at least recognize that when you define the custom label color tables, it will not fade the alpha.

In the meantime, you should be able to disable this by making this setting on each of your buttons:

[lua]

myButton._view._hasAlphaFade = false

[/lua]

Hope this helps,

Brent

@Brent Sorrentino

Thank you it works:)

Good to hear! This will be fixed in a daily build upcoming, such that if you define color tables (labelColor) for default and over, the internal alpha fade thing will be ignored.

Brent

labelColor only affects the text label of the button, not the button color.

Yes, you are right. I made me mistake in my explanation.

I mean text label changes alpha.

vanya, 

What are the other button parameters? The labelColor settings you posted should not change the text alpha. Must be something else going on.

local buttonEvent = widget.newButton

{

   sheet = buttonsSheet,

   defaultFrame = 2,

   overFrame = 1,

   fontSize  = 40,

   labelColor = { default={ 1, 1, 1,1 }, over={ 1, 1, 1, 1 } },

   label = “SPECIAL EVENT”,

   id = “event”,

   onEvent = handleButton

}

function handleButton  is empty.

To change the colour of the button and not the label text you want to set the fillColor property:

http://docs.coronalabs.com/daily/api/library/widget/newButton.html#fillcolor-optional

May be my explanation is awfull.

Thats why i attached screenshot bellow.

1 button is normall. 2 is pressed.

Why label of 1 and 2 button is different?

Hi @vanya.levchenko,

I think this is because there’s a “hidden” property of the widget button which makes the label fade in alpha on press. This is a borderline “bug” and I’m going to check into fixing it, or at least recognize that when you define the custom label color tables, it will not fade the alpha.

In the meantime, you should be able to disable this by making this setting on each of your buttons:

[lua]

myButton._view._hasAlphaFade = false

[/lua]

Hope this helps,

Brent

@Brent Sorrentino

Thank you it works:)

Good to hear! This will be fixed in a daily build upcoming, such that if you define color tables (labelColor) for default and over, the internal alpha fade thing will be ignored.

Brent