diff options
Diffstat (limited to '')
-rw-r--r-- | bin/assets/ScriptsAssetSet/osTextBoard.lsl | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/bin/assets/ScriptsAssetSet/osTextBoard.lsl b/bin/assets/ScriptsAssetSet/osTextBoard.lsl new file mode 100644 index 0000000..7aacab4 --- /dev/null +++ b/bin/assets/ScriptsAssetSet/osTextBoard.lsl | |||
@@ -0,0 +1,48 @@ | |||
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 | |||
7 | push_text() | ||
8 | { | ||
9 | compile_text(); | ||
10 | draw_text(); | ||
11 | } | ||
12 | |||
13 | compile_text() | ||
14 | { | ||
15 | title = "Some Title"; | ||
16 | subtitle = "Some subtitle"; | ||
17 | |||
18 | text = "Plenty of text for the main body.\n"; | ||
19 | text += "You need to manual do line breaks\n"; | ||
20 | text += "here. No word wrap yet."; | ||
21 | |||
22 | add = "Additional text at the bottom"; | ||
23 | } | ||
24 | |||
25 | draw_text() | ||
26 | { | ||
27 | string drawList = "MoveTo 40,80; PenColour RED; FontSize 48; Text " + title + ";"; | ||
28 | drawList += "MoveTo 160,160; FontSize 32; Text " + subtitle + ";"; | ||
29 | drawList += "PenColour BLACK; MoveTo 40,220; FontSize 24; Text " + text + ";"; | ||
30 | drawList += "PenColour RED; FontName Times New Roman; MoveTo 40,900; Text " + add + ";"; | ||
31 | osSetDynamicTextureData("", "vector", drawList, "1024", 0); | ||
32 | } | ||
33 | |||
34 | default { | ||
35 | state_entry() | ||
36 | { | ||
37 | push_text(); | ||
38 | } | ||
39 | |||
40 | touch_start(integer count) | ||
41 | { | ||
42 | push_text(); | ||
43 | if (channel >= 0) { | ||
44 | llSay(channel, text); | ||
45 | } | ||
46 | } | ||
47 | |||
48 | } | ||