test9.nim 439 B

123456789101112131415161718192021
  1. # --- Test 9. Use Label node. --- #
  2. import nodesnim
  3. Window("hello world")
  4. var
  5. main = Scene("Main")
  6. label = Label()
  7. main.addChild(label)
  8. label.setText("Hello, world!\nsecondline\nThis is a long sentence.") # Change label text.
  9. label.setTextAlign(0.2, 0.5, 0.2, 0.5) # try to change it ^^.
  10. label.setSizeAnchor(1, 1)
  11. label.setTextColor(Color(1f, 1f, 1f)) # default text color.
  12. addScene(main)
  13. setMainScene("Main")
  14. windowLaunch()