Computer Science Canada

help with For statements

Author:  Big_Tom [ Tue Jun 03, 2003 12:22 pm ]
Post subject:  help with For statements

Is it possible to make a for statment scroll the text across the screen. I know i can do it the only cath is i want it to be font.draw, rather then just normal text...ne help would be great.

Author:  Blade [ Tue Jun 03, 2003 12:28 pm ]
Post subject: 

ok. well pretty much just run a for loop from 0 to the end of the screen, being maxx..
code:
View.Set ("offscreenonly")
var font : int := Font.New ("Arial:30")
for i : 0 .. maxx
    Font.Draw ("Hello", i, maxx div 2, font, black)
    View.Update
    cls
end for

Author:  Tony [ Tue Jun 03, 2003 12:36 pm ]
Post subject: 

to scroll the text, you can take a picture of the screen (0,0,maxx,maxy) and move it up one line. Problem is, it will scroll only 1 way.

Author:  Big_Tom [ Wed Jun 04, 2003 8:17 am ]
Post subject: 

I want to make the text scroll across the screen letter by letter, for example when your declare the line as a constant and then sub it in latter in the program. What i need to be able to do is make it with fon.draw so i can make the cool matrix text.

Author:  Tony [ Wed Jun 04, 2003 9:26 am ]
Post subject: 

we have a bunch of different source codes for matrix effect...

Author:  Mephi [ Wed Jun 04, 2003 11:15 am ]
Post subject: 

as in text delay?

code:

procedure textDelay (word : string)
for i : 1 .. length(word)
Font.Draw (word (i), ....)
delay (30)
end for
end textDelay


i think this works....i dunno if this is wut u want tho..

Author:  Big_Tom [ Wed Jun 04, 2003 11:21 am ]
Post subject: 

No that doesn't work and, it might be what i need but i dont know yet...so if it's possible can you please help me make the text scroll across the screen letter by letter IN font.draw

Author:  Tony [ Wed Jun 04, 2003 11:59 am ]
Post subject: 

just what Mephi posted... using Font.Draw to scroll letter by letter... You can ether do it horizontaly, or vertically... just depends which value you substitute with a loop counter.

Author:  Big_Tom [ Wed Jun 04, 2003 12:15 pm ]
Post subject: 

I Still can't get it to work it's really pissing me off to no end.

Author:  Mephi [ Wed Jun 04, 2003 8:22 pm ]
Post subject: 

i hope you didnt just copy+paste the code, cuz i wuz lazy and didnt put in a lot of stuff....newayz, heres for u lazy people:
code:
var font : int := Font.New ("Arial:12:bold")
procedure textDelay (word : string)
for i : 1 .. length(word)
Font.Draw (word (i), 1 + (15*i), 300, font, black)
delay (30)
end for
end textDelay

textDelay ("HELLO")

Author:  Blade [ Wed Jun 04, 2003 10:18 pm ]
Post subject: 

i dunno what you really want. but this may help you... you're gonna have to modify it a bit for what you want but its just scrolls one letter a time from top to bottom... i'm not doing the whole damn project for you because as most of you will agree... thats really stupid of you to ask lol

code:
View.Set ("offscreenonly")
var font : int := Font.New ("Arial:20")
var x : int

procedure scroll (word : string (30),del:int)
    for i : 1 .. length (word)
        x := Rand.Int (0, maxx)
        for decreasing k : maxy .. 0
            Font.Draw (word (i), x, k, font, black)
            View.Update
            delay (del)
            cls
        end for
    end for
end scroll

scroll ("hello",3)


: