test39.nim 523 B

1234567891011121314151617
  1. # --- Test 39. Use Scene builder. --- #
  2. import nodesnim
  3. Window("scene builder")
  4. build:
  5. - Scene scene:
  6. name: "Main scene"
  7. - Vbox background: # Instead of var background = Vbox()
  8. call setBackgroundColor(Color(21, 33, 48)) # You can change params without `objname`.param = value syntax.
  9. call setSizeAnchor(1.0, 0.1) # You can also call any method without `objname`.method(args) syntax. :eyes:
  10. call setAnchor(0.5, 0.5, 0.5, 0.5)
  11. echo background.size_anchor
  12. addMainScene(scene)
  13. windowLaunch()