Page 1 of 1

[23 Apr 2006] Text-scrolling

Posted: Sat Jun 13, 2020 5:31 pm
by Ferrule Media
Note: This is an archived post that was originally sent to the Hollywood mailing list on 23 Apr 2006 00:37:02 +0100

Hello!

My name is Torgeir (fuskoSCN), and this is my first posting here, I guess there will be some more postings by me rather soon :)

Beeing a demoscene-graphician, i have never written a single line of code in my life - but i hope to get the hang of Hollywood, so that im able to make some nice presentations. (the goal is to make a infochannel to my dentist-company).

hehe.i would like to say thanks for all the help this mailinglist can provide, and sorry about the dumb questions i may have :)

My first question is about scrolling text :

I have written the following code -

Code: Select all

SetFontcolor(#white)
SetFont("abaddon.font",80)
SetFontStyle(#antialias)
CreateTextObject(1,"scrolltext")
MoveTextObject(1,#rightout,#bottom,#leftout,#bottom,1)
As you can see i would like to scroll text over the screen, but my problem is that it scrolls much too fast - even if i have used the lowest possible speed-number.

Is there a way to get the text to scroll more slowly ?

I have also noticed that the scrolling speed is changing.. it scrolls faster in the start and in the end (when part of the word "scrolltext" is outside the screen) . Is it possible to get a same speed all the way ?

Best regards

Torgeir - aka - FuskoSCN

[23 Apr 2006] Re: Text-scrolling

Posted: Sat Jun 13, 2020 5:31 pm
by airsoftsoftwair
Note: This is an archived post that was originally sent to the Hollywood mailing list on Sun, 23 Apr 2006 11:46:29 +0200
Hello!

My name is Torgeir (fuskoSCN), and this is my first posting here, I guess there will be some more postings by me rather soon :)

Beeing a demoscene-graphician, i have never written a single line of code in my life - but i hope to get the hang of Hollywood, so that im able to make some nice presentations. (the goal is to make a infochannel to my dentist-company).

hehe.i would like to say thanks for all the help this mailinglist can provide, and sorry about the dumb questions i may have :)

My first question is about scrolling text :

I have written the following code -

Code: Select all

SetFontcolor(#white)
SetFont("abaddon.font",80)
SetFontStyle(#antialias)
CreateTextObject(1,"scrolltext")
MoveTextObject(1,#rightout,#bottom,#leftout,#bottom,1)
, as you can see i would like to scroll text over the screen, but my problem is that it scrolls much too fast - even if i have used the lowest possible speed-number.

Is there a way to get the text to scroll more slowly ?
Yes. You have to scroll the text on your own. First, convert the text object to a sprite:

Code: Select all

CreateSprite(1, #TEXTOBJECT, 1)
And then scroll it using code like this:

Code: Select all

maxfps = 25        ; speed of the scroller
width = GetAttribute(#SPRITE, 1, #ATTRWIDTH)

StartTimer(1)

For x = 640 To -width Step -1
   DisplaySprite(1, x, #BOTTOM)
   WaitTimer(1, 1000 \ maxfps)
Next
You can adjust the speed of the scroller by modifying the "maxfps" variable. If the scroller is too slow even with high fps, try to increase the step variable to -2, -3, -4...