mIRC Home    About    Download    Register    News    Help

Print Thread
#196240 13/03/08 04:59 PM
Joined: Mar 2007
Posts: 139
S
Solo1 Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Mar 2007
Posts: 139
Hi Guys
I want to make a scrolling text in a project of mine but i need a kick start as i have no idea where to start, and need an example. If i have a window called @scroll how would i scroll "this is scrolling text" in that window.

Thank You.

Solo1 #196241 13/03/08 05:25 PM
Joined: Aug 2007
Posts: 334
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Aug 2007
Posts: 334
do u just want it to slide across the window, looping forever? and which direction


This is not the signature you are looking for
Joined: Mar 2007
Posts: 139
S
Solo1 Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Mar 2007
Posts: 139
Hi
I just want a small example i can work off. For now lets have it running on an endless loop and scrolling upwards. But any example will help me.

Thank-You

Solo1 #196268 14/03/08 01:07 AM
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
This code should make the given message scroll in a dialog editbox. It should be a good starting point for you.

Code:

alias mq.start {
  ;*** Call to start the scrolling
  unset %mq.*
  set %mq.point 0
  .timer.mq -m 0 500 mq.disp
}

alias mq.disp {
  ;*** Scrolls one character for each call (chr(32) ignored)
  var %mq.title = This is the text to scroll in the textbox
  inc %mq.point 1
  if (%mq.point > $len(%mq.title)) set %mq.point 1
  if ($mid(%mq.title,%mq.point,1) == $chr(32)) inc %mq.point 1
  var %mq.disp = $right(%mq.title,$calc($len(%mq.title) - %mq.point)) $left(%mq.title,%mq.point)
  echo -a did -ra <id_of_textbox> %mq.disp
}

alias mq.stop {
  unset %mq.*
  .timer.mq off
}



-genius_at_work

Joined: Mar 2007
Posts: 139
S
Solo1 Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Mar 2007
Posts: 139
Hi genius_at_work
That is an absolutely fabulous example, i have created the dialog and got it working and understand the concept. The only trouble i have at the moment is that the text is scrolling but the whole text shows in the edit box before it starts scrolling, is it possible that is should start scrolling from the first character?

Solo1 #196288 14/03/08 02:30 PM
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
So you want the text to display 1 character at a time until it is all showing, and then continue scrolling from then on? If so, then yes you can. I would do it by making a separate alias to do that first part, and then start calling the existing alias after the full text is displayed. You should be able to reuse part of the existing alias and just modify it so it only shows the $left part. I can give an example after work.

-genius_at_work

Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
Originally Posted By: genius_at_work
This code should make the given message scroll in a dialog editbox. It should be a good starting point for you.

Code:

alias mq.start {
  ;*** Call to start the scrolling
  unset %mq.*
  set %mq.point 0
  .timer.mq -m 0 500 mq.disp
}

alias mq.disp {
  ;*** Scrolls one character for each call (chr(32) ignored)
  var %mq.title = This is the text to scroll in the textbox
  inc %mq.point 1
  if (%mq.point > $len(%mq.title)) set %mq.point 1
  if ($mid(%mq.title,%mq.point,1) == $chr(32)) inc %mq.point 1
  var %mq.disp = $right(%mq.title,$calc($len(%mq.title) - %mq.point)) $left(%mq.title,%mq.point)
  echo -a did -ra <id_of_textbox> %mq.disp
}

alias mq.stop {
  unset %mq.*
  .timer.mq off
}



-genius_at_work

Lo !

I found this code intresting so i tested it a bit, and i noticed one problem with it, if you add color to the text, then when it scrolling it will send the number for the color, not the color. Can someone explain to me why? smile and how it can be solved a easy way smile


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
sparta #196371 15/03/08 09:04 PM
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
The code was written to scroll text in a dialog editbox. Editboxes do not support color codes (as anything other than regular ascii characters) so the script does not make allowances for color codes in the text. You could correct this by detecting the control codes, and rearranging them as necessary to display properly.

-genius_at_work

Joined: Mar 2007
Posts: 139
S
Solo1 Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Mar 2007
Posts: 139
Hi, just reminding you about that example promised.


Link Copied to Clipboard