ArtDelegate.qml 588 B

1234567891011121314151617181920212223
  1. import QtQuick 2.5
  2. import Box2D 2.0
  3. import Qt.labs.settings 1.0
  4. ImageBoxBody {
  5. id: picture
  6. function detonate() { settings.animateDeath ? destroyAnimation.start() : picture.destroy() }
  7. density: 0.01
  8. friction: 1.0
  9. fixedRotation: parent.fixedRotation
  10. world: parent.physicsWorld
  11. bodyType: Body.Dynamic
  12. source: "file://" + imageModel.randomPicture()
  13. SequentialAnimation {
  14. id: destroyAnimation
  15. NumberAnimation { target: picture; property: "height"; to: 0; duration: 1000 }
  16. ScriptAction { script: { picture.destroy(); } }
  17. }
  18. }