load image button in widget

Hi…

I’ve a simple question.

I want put in option game the possiblity to choice image button (with system save/load function). 

I tried to insert in “default image” a variables who load image ("images/button1.png) but it doesn’t run.

So, Is it possible load different image in a widget button? Or it isn’t possible with api widget.button ?

Yes, it is possible to change the images in a widget button, but you might need two variables to hold the two different states – i.e. it isn’t enough to define a “default image” for the button, you have to also define an image for when the button is pressed (usually this is just a re-colored version of the “default” image, but Corona can’t know that, you could give it a different size, shape, color, etc.).

In the docs (https://docs.coronalabs.com/api/library/widget/newButton.html), look for the “2-Image Construction” section … you just identify the defaultFile (for the un-pressed state) and the overFile (for the pressed state).

If that’s not what you’re looking for, then we might need to see some of your code.

Yes, it is possible to change the images in a widget button, but you might need two variables to hold the two different states – i.e. it isn’t enough to define a “default image” for the button, you have to also define an image for when the button is pressed (usually this is just a re-colored version of the “default” image, but Corona can’t know that, you could give it a different size, shape, color, etc.).

In the docs (https://docs.coronalabs.com/api/library/widget/newButton.html), look for the “2-Image Construction” section … you just identify the defaultFile (for the un-pressed state) and the overFile (for the pressed state).

If that’s not what you’re looking for, then we might need to see some of your code.