Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Scrolling Hovertext Marquee

Miles05 Reitveld
Kitsune Mage
Join date: 24 Apr 2005
Posts: 28
01-21-2006 06:02
Hey there... I've been looking, over a month, for an example script on how hovertext marquees work, but those that had it weren't willing to share... is anyone kind enough to let me see how it works?
Thraxis Epsilon
Registered User
Join date: 31 Aug 2005
Posts: 211
01-21-2006 09:33
From: Miles05 Reitveld
Hey there... I've been looking, over a month, for an example script on how hovertext marquees work, but those that had it weren't willing to share... is anyone kind enough to let me see how it works?


Well the basic idea is to decide how many characters you want your Marquee to display.... then you use an llGetSubString on a timer to grab text and display it in your hovertext. When you reach the end of the string... start over.
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
01-21-2006 10:54
i dont have it anymore but theres a free one in one of yandi's script boxes (over at the junkyard)
Jokey Domela
Registered User
Join date: 27 Jul 2005
Posts: 83
01-21-2006 12:58
Dropping you one in game...
Andy Enfield
Hippo Technologies CEO
Join date: 22 Nov 2005
Posts: 79
Scrolling HoverText
01-21-2006 16:03
Here is mine:

CODE

// Scrolling Hovertext Script
// by Andy Enfield
// Version 1.0

integer start_pos;

// *********************************************************************

integer scroll_text (string message, integer characters, integer start, vector colour, float alpha)
{
string temp;

if ((start + characters) < llStringLength(message))
{
temp = llGetSubString(message, start, start + characters);
}
else
{
temp = llGetSubString(message, start, llStringLength(message) - 1);
temp += llGetSubString(message, 0, characters - llStringLength(temp));
}
llSetText(temp, colour, alpha);
start += 1;
if (start >= llStringLength(message)) {start = 0;}
return start;
}

// *********************************************************************

default
{
state_entry()
{
llSetTimerEvent(0.2);
}

timer()
{
start_pos = scroll_text(" ... The quick brown fox jumps over the lazy dog ... ", 30, start_pos, <1,1,0>, 1);
}

}