Author Topic: Text Scroller  (Read 2723 times)

0 Members and 1 Guest are viewing this topic.

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Text Scroller
« on: June 26, 2007, 11:09:38 am »
Script Name: Text Scroller
Script Description: Draws text that scrolls across the screen
Original Author: Curt (DorkeyDear)
Core Version: 2.6.1b
Code:
Code: [Select]
procedure DrawScrollText(ID: byte; Text: string; Offset, Delay, Times,X,Y: integer; Color: longint; Scale: Single);
begin
  if Offset <> 0 then Text := Copy(Text,Offset + 1,Length(Text)) + Copy(Text,1,Offset);
  while Times >= 1 do begin
    DrawText(ID,Text,Delay + 150,Color,Scale,X,Y);
    Text := Copy(Text,2,Length(Text)) + Text[1];
    Sleep(Delay);
    Times := Times - 1;
  end;
end;
Called: This is called using the ThreadFunc procedure only once
Example:
Code: [Select]
procedure ActivateServer();
var
  Text: string;
begin
  Text := 'This scrolls! - '
  ThreadFunc([0,Text,200,Length(Text) * 10,8,400,RGB(255,255,255),0.1],'DrawScrollText');
end;
Future changes: Having a option for scrolling left / right; Having a separator input
Notes: The argument Times referes to the number of times the text scrolls over 1 characters, not the number of times it loops. If you want to get the number of times it should loop, do Length(Text) * Num wheres as Num is the number of times it loops and Text is the text to be scrolled.

Offline zyxstand

  • Veteran
  • *****
  • Posts: 1106
  • Mother of all Bombs
Re: Text Scroller
« Reply #1 on: June 28, 2007, 01:11:12 pm »
This seems to to scroll text by characters.  Characters aren't always same width with DrawText and therefore will create uneven scrolling rate.
Further, this will overwrite (and kill) any previous messages almost instantly.
Criticism makes programmers better!
Can't think of anything original to put here...

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Text Scroller
« Reply #2 on: June 28, 2007, 01:51:07 pm »
Nothing I can do about the text with other than by suggesting people to changing their font.
Nothing I can do about the overwriting the _ has killed u and you killed _ and other messages
If I could set the font, then I would definitely make it default Lucida Console or maybe Courier New if there was popular demand for it to be default.
Now if the text was all the same width, I would implement the X changing position to make it a smooth scrolling :)
You think I should implement it anyways, for those who already have a font set with the same width for each character?
Maybe I should set a boolean if you want to enable it or not...

Offline zyxstand

  • Veteran
  • *****
  • Posts: 1106
  • Mother of all Bombs
Re: Text Scroller
« Reply #3 on: June 28, 2007, 10:49:00 pm »
no - too much work that's unnecessary because nobody would want something that overwrites all non-console messages.  Sry to break it to ya like that :/
Can't think of anything original to put here...

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Text Scroller
« Reply #4 on: June 29, 2007, 11:34:43 am »
You think I make scripts for popular / public demand? I make scripts because thats what entertains me.