test43.nim 513 B

123456789101112131415161718
  1. # --- Test 43. Use AnimationPlayer. --- #
  2. import nodesnim
  3. Window("AnimationPlayer")
  4. build:
  5. - Scene scene:
  6. - ColorRect rect:
  7. color: Color(0, 0, 0)
  8. call resize(100, 100)
  9. - AnimationPlayer animation:
  10. call addState(rect.color.r.addr, @[(tick: 0, value: 0.0), (tick: 200, value: 1.0)])
  11. call addState(rect.position.x.addr, @[(tick: 0, value: 0.0), (tick: 50, value: 50.0), (tick: 200, value: 100.0)])
  12. call setDuration(200)
  13. call play()
  14. addMainScene(scene)
  15. windowLaunch()