Stack With Friends Demo
import QtQuick 2.0
import Felgo 3.0
EntityBaseDraggable {
id: obstacle
entityType: "obstacleBlock"
width: 32
height: 32
levelWidth: gameScene.width
colliderComponent: collider
selectionMouseArea.anchors.fill: sprite
inLevelEditingMode: gameScene.state === "levelEditing"
dragOffset: Qt.point(0,0)
gridSize: 16
colliderSize: width
opacityChangeItemWhileSelected: sprite
onEntityClicked: gameScene.entitySelected(obstacle)
onEntityPressAndHold: removeEntity()
delayDragOffset: true
Item {
id: sprite
x: -width/2
y: -height/2
width: parent.width
height: parent.height
Image {
source: "../../assets/img/block.png"
width: 16
height: 16
}
Image {
source: "../../assets/img/block.png"
width: 16
height: 16
x: 16
}
Image {
source: "../../assets/img/block.png"
width: 16
height: 16
y: 16
}
Image {
source: "../../assets/img/block.png"
width: 16
height: 16
x: 16
y: 16
}
}
BoxCollider {
id: collider
x: -width/2
y: -height/2