test45.nim 503 B

12345678910111213141516171819202122232425
  1. # --- Test 45. Use GradientDrawable and Control. --- #
  2. import nodesnim
  3. Window("drawable oops")
  4. build:
  5. - Scene scene:
  6. - Control ctrl:
  7. call resize(100, 150)
  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. ctrl.setBackground(gradient)
  17. addMainScene(scene)
  18. windowLaunch()