Difference between revisions of "ScrollText"
Jump to navigation
Jump to search
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
==ScrollText== | ==ScrollText 1.5== | ||
<lsl>//ScrollText - using SetText to make a scroll effect.// | <lsl> | ||
//ScrollText - using SetText to make a scroll effect.// | |||
//Written by Bios Winter & Kalie Denimore.// | //Written by Bios Winter & Kalie Denimore.// | ||
//Gutted by Strife Onizuka.// | //Gutted by Strife Onizuka.// | ||
ScrollText(string text,integer letters){ | //Added rate argument - Kalie// | ||
ScrollText(string text,integer letters,float rate){ | |||
integer length = llStringLength(text); | integer length = llStringLength(text); | ||
integer i = -1; | integer i = -1; | ||
Line 10: | Line 12: | ||
llSetText( llGetSubString(text, i, i + letters), | llSetText( llGetSubString(text, i, i + letters), | ||
<1.0, 1.0, 1.0>, 1.0); | <1.0, 1.0, 1.0>, 1.0); | ||
llSleep( | llSleep(rate); | ||
} | } | ||
llSetText("", <1.0, 1.0, 1.0>, 1.0); | llSetText("", <1.0, 1.0, 1.0>, 1.0); | ||
Line 17: | Line 19: | ||
default{ | default{ | ||
state_entry(){ | state_entry(){ | ||
ScrollText("Hello, Avatar!",10); | ScrollText("Hello, Avatar!",10,.2); | ||
} | } | ||
} | } | ||
</lsl> | </lsl> |
Latest revision as of 15:09, 18 December 2008
ScrollText 1.5
<lsl> //ScrollText - using SetText to make a scroll effect.// //Written by Bios Winter & Kalie Denimore.// //Gutted by Strife Onizuka.// //Added rate argument - Kalie// ScrollText(string text,integer letters,float rate){
integer length = llStringLength(text); integer i = -1; letters -= 1; while((++i) < length){ llSetText( llGetSubString(text, i, i + letters), <1.0, 1.0, 1.0>, 1.0); llSleep(rate); } llSetText("", <1.0, 1.0, 1.0>, 1.0);
}
default{
state_entry(){ ScrollText("Hello, Avatar!",10,.2); }
}
</lsl>