Advertisement
Guest User

lainwir3d

a guest
Oct 21st, 2014
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 1.38 KB | None | 0 0
  1. Repeater{
  2.         model:346/4
  3.         Rectangle {
  4.             id:noise
  5.  
  6.             smooth: true
  7.             antialiasing: true
  8.  
  9.             z:-3
  10.             width: 100
  11.             height: 4
  12.             color: "lightgrey"
  13.             opacity:0.5
  14.  
  15.             transform: Rotation{
  16.                 angle: index*4+8
  17.                 origin.x: 0
  18.                 origin.y: 2
  19.             }
  20.  
  21.             x: parent.width / 2 + (ancCircle.width+3) / 2 * Math.cos((index*4+8) * Math.PI / 180)
  22.             y: parent.height / 2 + (ancCircle.width+3) / 2 * Math.sin((index*4+8) * Math.PI / 180) - height/2
  23.  
  24.             NumberAnimation {
  25.                 id: animNoise
  26.                 target: noise;
  27.                 property: "width";
  28.                 duration: 1000;
  29.                 easing.type: Easing.InQuad
  30.  
  31.                 property bool first: true
  32.  
  33.                 from: 50
  34.                 to: index
  35.  
  36.                 onStopped: {
  37.                     animNoise.from = noise.width;
  38.                     animNoise.to = Math.ceil(Math.random() * 30)+parent.fixedRandomNoiseCoeff;
  39.                     animNoise.duration = 2000;
  40.                     easing.type = Easing.Linear
  41.  
  42.                     if(Qt.application.active) animNoise.start();
  43.  
  44.                 }
  45.  
  46.  
  47.             }
  48.  
  49.             Component.onCompleted: {
  50.                 animNoise.start();
  51.             }
  52.         }
  53.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement