Warning, /education/gcompris/external/qml-box2d/examples/demolition/WoodenBox.qml is written in an unsupported language. File is not indexed.

0001 import QtQuick 2.0
0002 import Box2D 2.0
0003 import "../shared"
0004 
0005 Item {
0006     id: woodenBox
0007 
0008     width: 100
0009     height: 100
0010 
0011     BoxBody {
0012         id: body
0013 
0014         world: physicsWorld
0015         target: woodenBox
0016         bodyType: Body.Dynamic
0017 
0018         density: 1
0019         friction: 0.4
0020         restitution: 0.5
0021 
0022         width: woodenBox.width
0023         height: woodenBox.height
0024     }
0025 
0026     Image {
0027         anchors.fill: parent
0028         anchors.margins: -1
0029         source: "images/woodenbox.png"
0030     }
0031 
0032     MouseArea {
0033         anchors.fill: parent
0034         onClicked: body.applyTorque(400)
0035     }
0036 }