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

0001 import QtQuick 2.0
0002 import Box2D 2.0
0003 
0004 Rectangle {
0005     id: ball
0006 
0007     radius: 180
0008 
0009     gradient: Gradient {
0010         GradientStop { position: 0.0; color: "red" }
0011         GradientStop { position: 0.5; color: "yellow" }
0012         GradientStop { position: 1.0; color: "green" }
0013     }
0014 
0015     property Body body: Body {
0016         target: ball
0017         world: physicsWorld
0018 
0019         fixedRotation: false
0020         sleepingAllowed: false
0021         bodyType: Body.Dynamic
0022 
0023         Circle {
0024             radius: width / 2
0025             density: 1
0026             friction: 1
0027             restitution: 0.3
0028         }
0029     }
0030 }