Advertisement
tasuku

Untitled

Jan 21st, 2013
380
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. import QtQuick 2.0
  2.  
  3. Rectangle {
  4. id: root
  5. width: 600
  6. height: 400
  7. color: "black"
  8.  
  9. Rectangle{
  10. anchors.centerIn: parent
  11. width: parent.width / 4
  12. height: parent.height / 2
  13. // clip: true
  14.  
  15. SequentialAnimation on width {
  16. loops: Animation.Infinite
  17. NumberAnimation { to: root.width / 2; duration: 1000 }
  18. NumberAnimation { to: root.width / 4; duration: 1000 }
  19. PauseAnimation { duration: 250 }
  20. }
  21.  
  22. SequentialAnimation on height {
  23. loops: Animation.Infinite
  24. PauseAnimation { duration: 250 }
  25. NumberAnimation { to: root.height / 4; duration: 1000 }
  26. NumberAnimation { to: root.height / 2; duration: 1000 }
  27. }
  28.  
  29.  
  30. GradientEx{
  31. id: grad
  32. gradient: Gradient{
  33. GradientStop { position: 0.0; color: "red" }
  34. GradientStop { position: 0.33; color: "yellow" }
  35. GradientStop { position: 1.0; color: "green" }
  36. }
  37. // rotation: (2 * (parent.x - 400)) % 360
  38. NumberAnimation on rotation { from: 0; to: 360; duration: 5000; loops: Animation.Infinite }
  39. }
  40.  
  41. //ちゃんとグラデの四角が良いサイズになってるか確認する用の四角(親のclipは解除して確認する)
  42. Rectangle{
  43. anchors.fill: parent
  44. opacity: 0.5
  45. }
  46. }
  47.  
  48. Text{
  49. text: "angle=" + grad.rotation
  50. color: "white"
  51. }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement