Hello, i was trying to make reusable objects for my game so i made an Button.qml but now when i try to add an MouseArea in my created custom button it dont work. Am i missing something here about this? Because if i create an rectangle and put an mousearea inside that it works just fine.
Main.qml
Button {
id: playButton
buttonFrame: ["PlayButtonUp.png"]
x: 100
y: 240
MouseArea {
anchors.fill: parent
onPressed: {
console.log("test")
}
}
}
Button.qml
import Felgo 3.0
import QtQuick 2.0
EntityBase {
id: button
entityType: "button"
property alias buttonFrame: buttonTexture.frameNames
TexturePackerAnimatedSpriteVPlay {
id: buttonTexture
source: "../assets/PSFSheet.json"
}
}