StackTheBoxWithEditor Demo
import QtQuick 2.0
import Felgo 3.0
EntityBase {
id: box
entityType: "box"
width: 32
height: 32
transformOrigin: Item.TopLeft
Image {
id: boxImage
source: "../../assets/img/box.png"
anchors.fill: boxCollider
}
BoxCollider {
id: boxCollider
x: -width/2
y: -height/2
friction: 1.6
restitution: 0
density: 0.1
categories: Box.Category1
fixture.onBeginContact: {
collisionSound.play();
collisionParticleEffect.start();
}
EditableComponent {
editableType: "Balancing"
defaultGroup: "Box"
properties: {
"friction": {"min": 0, "max": 10, "stepsize": 0.1 },
"restitution": {"min": 0, "max": 1,"stepsize": 0.1 },
"density": {"min": 0, "max": 1000, "stepsize": 10 }
}
}
}
SoundEffect {
id: collisionSound
source: "../../assets/snd/boxCollision.wav"
}
Particle {
id: collisionParticleEffect
positionType: 0