test44.nim 572 B

123456789101112131415161718192021222324252627
  1. # --- Test 44. Use GradientDrawable and Control. --- #
  2. import nodesnim
  3. Window("drawable oops")
  4. build:
  5. - Scene scene:
  6. - Control ctrl:
  7. call resize(256, 256)
  8. call move(150, 50)
  9. var gradient = GradientDrawable()
  10. gradient.setCornerRadius(16)
  11. gradient.setCornerDetail(16)
  12. gradient.enableShadow(true)
  13. gradient.setShadowOffset(Vector2(15, 15))
  14. gradient.setBorderColor(Color(1.0, 0.5, 0.5, 0.1))
  15. gradient.setBorderWidth(5)
  16. gradient.setStyle(style({
  17. corner-color: "#ff7 #ff7 #f77 #f77"
  18. }))
  19. ctrl.setBackground(gradient)
  20. addMainScene(scene)
  21. windowLaunch()