test45.nim 444 B

12345678910111213141516171819202122232425262728
  1. # --- Test 45. Use Drawable and Control. --- #
  2. import nodesnim
  3. Window("drawable oops")
  4. build:
  5. - Scene scene:
  6. - Control ctrl
  7. scene.addChild(ctrl)
  8. ctrl.resize(256, 96)
  9. ctrl.move(64, 64)
  10. ctrl.setStyle(style(
  11. {
  12. background-color: rgb(33, 65, 87),
  13. border-radius: 8,
  14. border-width: 1,
  15. border-color: rgb(0, 0, 0),
  16. shadow: true,
  17. shadow-offset: 3,
  18. size-anchor: "0.5 0.7"
  19. }
  20. ))
  21. addMainScene(scene)
  22. windowLaunch()