Button Images

One question…

Why is it impossible to set the default and over image of an button after creation?

I just have to change the appearance of an button and I feel like I have to invent rocket science 

Just provide a property that can be set to any image, whats the problem with that?

And thats not the only blocking thing in Corona, I begin to think Corona has to change it’s slogan to “build apps 10x slower”…

One question…

Why is it impossible to set the default and over image of an button after creation?

I just have to change the appearance of an button and I feel like I have to invent rocket science 

Just provide a property that can be set to any image, whats the problem with that?

And thats not the only blocking thing in Corona, I begin to think Corona has to change it’s slogan to “build apps 10x slower”…

It is possible but to do this means destroying and recreating the button, whether we do it in internally or you do it in your code, it makes no difference. The procedure is still the same. It isn’t as simple as adding a property.

That is what I do now.

The problem is that I have buttons that display a letter and change their appearance if they display a letter or display nothing at all.

Example:

I have 5 buttons next to each other displaying H E L L O

If I now click on the E, it should turn to display nothing and change its appearance.

I remove the E button, create a new one with the correct image and label, insert it into the display group at the index

group:insert(oldButtonIndex, newButton)  

 the old button was, but if I now try to loop trough the buttons from the start

for i = 1, group.numChildren do         local button = group[i] print(button:getLabel()) end  

 I’ll get H L L O (new button) where I should be H (new button) L L O

One question…

Why is it impossible to set the default and over image of an button after creation?

I just have to change the appearance of an button and I feel like I have to invent rocket science 

Just provide a property that can be set to any image, whats the problem with that?

And thats not the only blocking thing in Corona, I begin to think Corona has to change it’s slogan to “build apps 10x slower”…

It is possible but to do this means destroying and recreating the button, whether we do it in internally or you do it in your code, it makes no difference. The procedure is still the same. It isn’t as simple as adding a property.

That is what I do now.

The problem is that I have buttons that display a letter and change their appearance if they display a letter or display nothing at all.

Example:

I have 5 buttons next to each other displaying H E L L O

If I now click on the E, it should turn to display nothing and change its appearance.

I remove the E button, create a new one with the correct image and label, insert it into the display group at the index

group:insert(oldButtonIndex, newButton)  

 the old button was, but if I now try to loop trough the buttons from the start

for i = 1, group.numChildren do         local button = group[i] print(button:getLabel()) end  

 I’ll get H L L O (new button) where I should be H (new button) L L O