Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 help with For statements
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Big_Tom




PostPosted: 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.
Sponsor
Sponsor
Sponsor
sponsor
Blade




PostPosted: Tue Jun 03, 2003 12:28 pm   Post subject: (No 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
Tony




PostPosted: Tue Jun 03, 2003 12:36 pm   Post subject: (No 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.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Big_Tom




PostPosted: Wed Jun 04, 2003 8:17 am   Post subject: (No 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.
Tony




PostPosted: Wed Jun 04, 2003 9:26 am   Post subject: (No subject)

we have a bunch of different source codes for matrix effect...
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Mephi




PostPosted: Wed Jun 04, 2003 11:15 am   Post subject: (No 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..
Big_Tom




PostPosted: Wed Jun 04, 2003 11:21 am   Post subject: (No 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
Tony




PostPosted: Wed Jun 04, 2003 11:59 am   Post subject: (No 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.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Big_Tom




PostPosted: Wed Jun 04, 2003 12:15 pm   Post subject: (No subject)

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




PostPosted: Wed Jun 04, 2003 8:22 pm   Post subject: (No 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")
Blade




PostPosted: Wed Jun 04, 2003 10:18 pm   Post subject: (No 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)
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 11 Posts ]
Jump to:   


Style:  
Search: