astazed
astazed

Reputation: 649

Corona widget.newButton change defaultFile

Considering I am defining some button like the following:

-- title button
titleButton = widget.newButton{
    label="",
    width=265, height=70,
    defaultFile = "images/title.png",
    overFile = "images/title_clicked.png",
    onEvent = handlePlayEvent
}
titleButton:setReferencePoint(display.CenterReferencePoint)
titleButton.x = display.contentWidth / 2
titleButton.y = display.contentHeight / 4

Is it possible to modify the button's defaultFile and overFile after creation from some other function.

I have searched the docs and couldn't find anything. Any tip would be appreciated

Upvotes: 0

Views: 1669

Answers (1)

NaviRamyle
NaviRamyle

Reputation: 4007

You can't change defaultFile and overFile after its creation.

Like display.newImage(), you can't directly change the image itself unless it is an image sheet.

But you can use image sheet as a button. You can change its frame whenever you want.

Upvotes: 2

Related Questions