Hi
I’m experimenting & learning the basics. I am trying the following code to swap the up button art with down button art. The following 2 sections show a method with MultiResolutionImage
which doesn’t alternate the art (shows only up art regardless of press) but using Image
works. What did I do wrong? I suppose I should use a sprite sheet, so maybe that might work better in my case.
MultiResolutionImage {
source: ma.pressed ? "btn/buttondown.png" : "btn/buttonup.png"
anchors.centerIn: parent
Text {
text: "Test MIR"
font.pointSize: 14
anchors.centerIn: parent
}
MouseArea {
id: ma
anchors.fill: parent
onClicked: console.log("MIR button was clicked")
}
}
Image {
source: ma2.pressed ? "btn/buttondown-sd.png" : "btn/buttonup-sd.png"
anchors.bottom: parent.bottom
Text {
text: "Test Img"
font.pointSize: 14
anchors.centerIn: parent
}
MouseArea {
id: ma2
anchors.fill: parent
onClicked: console.log("Regular button was clicked")
}
}
Cheers,
Michael.