osTextBoard.lsl 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. string title = "";
  2. string subtitle = "";
  3. string text = "";
  4. string add = "";
  5. integer channel = 0; // if this is >= 0, llSay on that channel on updates
  6. push_text()
  7. {
  8. compile_text();
  9. draw_text();
  10. }
  11. compile_text()
  12. {
  13. title = "Some Title";
  14. subtitle = "Some subtitle";
  15. text = "Plenty of text for the main body.\n";
  16. text += "You need to manual do line breaks\n";
  17. text += "here. No word wrap yet.";
  18. add = "Additional text at the bottom";
  19. }
  20. draw_text()
  21. {
  22. string drawList = "MoveTo 40,80; PenColour RED; FontSize 48; Text " + title + ";";
  23. drawList += "MoveTo 160,160; FontSize 32; Text " + subtitle + ";";
  24. drawList += "PenColour BLACK; MoveTo 40,220; FontSize 24; Text " + text + ";";
  25. drawList += "PenColour RED; FontName Times New Roman; MoveTo 40,900; Text " + add + ";";
  26. osSetDynamicTextureData("", "vector", drawList, "1024", 0);
  27. }
  28. default {
  29. state_entry()
  30. {
  31. push_text();
  32. }
  33. touch_start(integer count)
  34. {
  35. push_text();
  36. if (channel >= 0) {
  37. llSay(channel, text);
  38. }
  39. }
  40. }