From e9a61e7c746a8f63f922c0cf2f0b46d55e29feef Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Mon, 23 Jun 2008 05:15:30 +0000 Subject: Update svn properties. --- bin/assets/ScriptsAssetSet/GrafittiBoard.lsl | 148 +++++++++++++-------------- 1 file changed, 74 insertions(+), 74 deletions(-) (limited to 'bin/assets/ScriptsAssetSet/GrafittiBoard.lsl') diff --git a/bin/assets/ScriptsAssetSet/GrafittiBoard.lsl b/bin/assets/ScriptsAssetSet/GrafittiBoard.lsl index d30e8f0..954e3ea 100644 --- a/bin/assets/ScriptsAssetSet/GrafittiBoard.lsl +++ b/bin/assets/ScriptsAssetSet/GrafittiBoard.lsl @@ -1,74 +1,74 @@ -// Grafitti board 0.0.2 for OpenSim -// By Justin Clark-Casey (justincc) -// http://justincc.wordpress.com - -// This script is available under the BSD License - -string text = ""; - -int LISTENING_CHANNEL = 43; - -// XXX Only putting this here as well to get around OpenSim's int -> string casting oddness -string LISTENING_CHANNEL_STRING = "43"; - -// FIXME: Should be dynamic! -int CHARS_WIDTH = 42; - -default -{ - state_entry() - { - llSetText( - "Say /" + LISTENING_CHANNEL_STRING + " to add text." - + " Say /" + LISTENING_CHANNEL_STRING - + " !clear to clear board", - <0.0, 1.0, 0.0>, 1.0); - - llListen(LISTENING_CHANNEL, "", NULL_KEY, ""); - - addGraffiti("justincc's graffiti board v0.0.2"); - addGraffiti("Now with primitive word wrap!"); - draw(); - } - - listen(integer channel, string name, key id, string message) - { - if (message == "!clear") - { - clearGraffiti(); - } - else - { - addGraffiti(message); - } - - draw(); - } -} - -// Add some additional graffiti -void addGraffiti(string message) -{ - while (llStringLength(message) > CHARS_WIDTH) - { - text += "\n\n" + llGetSubString(message, 0, CHARS_WIDTH - 1); - message = llDeleteSubString(message, 0, CHARS_WIDTH - 1); - } - - text += "\n\n" + message; -} - -// Clear the existing graffiti -void clearGraffiti() -{ - text = ""; -} - -// Actually fires the graffiti out to the dynamic texture module -void draw() -{ - //llSay(0, text); - string drawList = "PenColour BLACK; MoveTo 40,220; FontSize 32; Text " + text + ";"; - - osSetDynamicTextureData("", "vector", drawList, "1024", 0); -} +// Grafitti board 0.0.2 for OpenSim +// By Justin Clark-Casey (justincc) +// http://justincc.wordpress.com + +// This script is available under the BSD License + +string text = ""; + +int LISTENING_CHANNEL = 43; + +// XXX Only putting this here as well to get around OpenSim's int -> string casting oddness +string LISTENING_CHANNEL_STRING = "43"; + +// FIXME: Should be dynamic! +int CHARS_WIDTH = 42; + +default +{ + state_entry() + { + llSetText( + "Say /" + LISTENING_CHANNEL_STRING + " to add text." + + " Say /" + LISTENING_CHANNEL_STRING + + " !clear to clear board", + <0.0, 1.0, 0.0>, 1.0); + + llListen(LISTENING_CHANNEL, "", NULL_KEY, ""); + + addGraffiti("justincc's graffiti board v0.0.2"); + addGraffiti("Now with primitive word wrap!"); + draw(); + } + + listen(integer channel, string name, key id, string message) + { + if (message == "!clear") + { + clearGraffiti(); + } + else + { + addGraffiti(message); + } + + draw(); + } +} + +// Add some additional graffiti +void addGraffiti(string message) +{ + while (llStringLength(message) > CHARS_WIDTH) + { + text += "\n\n" + llGetSubString(message, 0, CHARS_WIDTH - 1); + message = llDeleteSubString(message, 0, CHARS_WIDTH - 1); + } + + text += "\n\n" + message; +} + +// Clear the existing graffiti +void clearGraffiti() +{ + text = ""; +} + +// Actually fires the graffiti out to the dynamic texture module +void draw() +{ + //llSay(0, text); + string drawList = "PenColour BLACK; MoveTo 40,220; FontSize 32; Text " + text + ";"; + + osSetDynamicTextureData("", "vector", drawList, "1024", 0); +} -- cgit v1.1