Stack With Friends Demo
import QtQuick 2.0
import Felgo 3.0
Item {
property variant obstacle: null
width: 32
height: 32
x: obstacle ? obstacle.x : 0
y: obstacle ? obstacle.y : 0
visible: obstacle != null
Image {
id: rotateIcon
width: 16
height: 16
x: 8
y: 8
source: "../../assets/img/rotate.png"
visible: obstacle ? obstacle.entityType === "obstacleTriangle" : false
MouseArea {
anchors.fill: parent
onClicked: {
if(obstacle.rotation === 270) obstacle.rotation = 0
else obstacle.rotation += 90
}
}
}
Image {
id: deleteIcon
width: 16
height: 16
x: 8
y: -24
source: "../../assets/img/delete.png"
MouseArea {
anchors.fill: parent
onClicked: {
obstacle.removeEntity()
obstacle = null
}