test42.nim 632 B

12345678910111213141516171819202122232425262728293031323334
  1. # --- Test 42. Use Drawable and Control. --- #
  2. import nodesnim
  3. Window("drawable oops")
  4. build:
  5. - Scene scene:
  6. - Control ctrl
  7. - Control ctrl1:
  8. call move(350, 100)
  9. call setSizeAnchor(0.2, 0.2)
  10. ctrl1.background.setTexture(load("assets/sharp.jpg"))
  11. ctrl1.background.setCornerRadius(25)
  12. ctrl1.background.setCornerDetail(25)
  13. ctrl.resize(256, 96)
  14. ctrl.move(64, 64)
  15. ctrl.setStyle(style(
  16. {
  17. background-color: rgb(33, 65, 87),
  18. border-radius: 8,
  19. border-width: 1,
  20. border-color: rgb(0, 0, 0),
  21. shadow: true,
  22. shadow-offset: 3,
  23. size-anchor: 0.5 0.7
  24. }
  25. ))
  26. addMainScene(scene)
  27. windowLaunch()