Warning, /education/gcompris/external/qml-box2d/examples/boxes/boxes.qml is written in an unsupported language. File is not indexed.
0001 import QtQuick 2.0 0002 import Box2D 2.0 0003 0004 Image { 0005 id: screen 0006 width: 640 0007 height: 480 0008 0009 source: "background.png" 0010 0011 World { id: physicsWorld } 0012 0013 Repeater { 0014 model: 3 0015 delegate: WoodenBox { 0016 x: Math.random() * (screen.width - 100) 0017 y: Math.random() * (screen.height / 3) 0018 rotation: Math.random() * 90 0019 } 0020 } 0021 0022 Wall { 0023 id: ground 0024 height: 20 0025 anchors { left: parent.left; right: parent.right; top: parent.bottom } 0026 } 0027 Wall { 0028 id: ceiling 0029 height: 20 0030 anchors { left: parent.left; right: parent.right; bottom: parent.top } 0031 } 0032 Wall { 0033 id: leftWall 0034 width: 20 0035 anchors { right: parent.left; bottom: ground.top; top: ceiling.bottom } 0036 } 0037 Wall { 0038 id: rightWall 0039 width: 20 0040 anchors { left: parent.right; bottom: ground.top; top: ceiling.bottom } 0041 } 0042 0043 DebugDraw { 0044 id: debugDraw 0045 world: physicsWorld 0046 anchors.fill: parent 0047 opacity: 0.75 0048 visible: false 0049 } 0050 0051 MouseArea { 0052 id: debugMouseArea 0053 anchors.fill: parent 0054 onPressed: debugDraw.visible = !debugDraw.visible 0055 } 0056 }