Platformer with Level Editor
import QtQuick 2.0
import QtQuick.Controls.Styles 1.0
import Felgo 3.0
GameButton {
id: imageButton
height: parent.height
property int borderWidth: 1
property color borderColor: "black"
property int radius: 3
property color color: "white"
property alias image: image
property alias hoverRectangle: hoverRectangle
style: ButtonStyle {
background: Rectangle {
border.width: imageButton.borderWidth
border.color: imageButton.borderColor
radius: imageButton.radius
gradient: Gradient {
GradientStop { position: 0.0; color: imageButton.color }
GradientStop { position: 1.0; color: Qt.tint(imageButton.color, "#24000000") }
}
}
}
onClicked: audioManager.playSound("click")
MultiResolutionImage {
id: image
anchors.fill: parent
anchors.margins: 1
fillMode: Image.PreserveAspectFit
}
Rectangle {
id: hoverRectangle
anchors.fill: parent
radius: imageButton.radius
color: "white"