test17.nim 551 B

12345678910111213141516171819202122232425
  1. # --- Test 17. Use RichLabel node. --- #
  2. import nodesnim
  3. Window("hello world")
  4. var
  5. mainobj: SceneObj
  6. main = Scene("Main", mainobj)
  7. labelobj: RichLabelObj
  8. label = RichLabel(labelobj)
  9. main.addChild(label)
  10. label.text = clrtext("Hello, world!\nsecondline\nThis is a long sentence.") # Change label text.
  11. label.setTextAlign(0.2, 0.5, 0.2, 0.5) # try to change it ^^.
  12. label.setSizeAnchor(1, 1)
  13. label.text.setColor(0, 4, Color(1, 0.6, 1))
  14. label.text.setColor(8, 16, Color(0xffccaaff'u32))
  15. addScene(main)
  16. setMainScene("Main")
  17. windowLaunch()