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

Username:   Password: 
 RegisterRegister   
 Text Effects
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
mike200015




PostPosted: Sun Jan 30, 2005 12:26 am   Post subject: Text Effects

i want to use the text effect that sorta makes ur text appear like a typewriter, but i want to incorporate that into Font.Draw so the text can be in a different font

This is the effect i want..
code:

var word :="Hello World"
for i : 1 .. length (word) 
    locate (1,i + 30)   
    put word (i) ..     
    delay (100)     
end for   

Does anyone know how to use that effect, but change the font??
Sponsor
Sponsor
Sponsor
sponsor
Mr. T




PostPosted: Sun Jan 30, 2005 12:31 am   Post subject: (No subject)

Hello, Mike! It's Alex.

The answer do you question is...

DO IT YOURSELF!

no autographs, please
mike200015




PostPosted: Sun Jan 30, 2005 12:49 am   Post subject: (No subject)

Pwned wrote:
Hello, Mike! It's Alex.

The answer do you question is...

DO IT YOURSELF!

no autographs, please

Stop Spamming the help section Alex
Mr. T




PostPosted: Sun Jan 30, 2005 1:03 am   Post subject: (No subject)

mike200015 wrote:
Pwned wrote:
Hello, Mike! It's Alex.

The answer do you question is...

DO IT YOURSELF!

no autographs, please

Stop Spamming the help section Alex


stop asking turing hax00rz to do your homework, mike
Neo




PostPosted: Sun Jan 30, 2005 1:34 am   Post subject: (No subject)

code:

var font : int := Font.New ("ROCKWELL:12:BOLD")
var word := "Hello World"
for i : 1 .. length (word)
    Font.Draw (word (i), 50 + (i*15), 50, font, green)
    delay (100)
end for
AsianSensation




PostPosted: Sun Jan 30, 2005 8:41 am   Post subject: (No subject)

Pwned wrote:
mike200015 wrote:
Pwned wrote:
Hello, Mike! It's Alex.

The answer do you question is...

DO IT YOURSELF!

no autographs, please

Stop Spamming the help section Alex


stop asking turing hax00rz to do your homework, mike


No seriously, stop spamming. -10 bits.
mike200015




PostPosted: Sun Jan 30, 2005 11:54 am   Post subject: (No subject)

Neo wrote:
code:

var font : int := Font.New ("ROCKWELL:12:BOLD")
var word := "Hello World"
for i : 1 .. length (word)
    Font.Draw (word (i), 50 + (i*15), 50, font, green)
    delay (100)
end for

Thanks Neo the code worked.
basketball4ever




PostPosted: Sun Jan 30, 2005 1:32 pm   Post subject: (No subject)

Another way to do it, not using Font.Draw
code:
var introline := "Hello World."
for a : 1 .. length (introline)
    put introline (a) ..
    delay (100)
end for


Basically an explanation:

first you declare a variable as a string, and put the message in it.
Then use a for loop, going from 1, to the number of characters in your variable string.
Next, put introline(a) is substituted to introline (1) displaying the 1st character
then introline (2) display the 2nd character, because the variable a goes from 1..length of the variable
a delay has to be put to make that effect

Hope this helps Smile.
Sponsor
Sponsor
Sponsor
sponsor
mike200015




PostPosted: Sun Jan 30, 2005 1:39 pm   Post subject: (No subject)

hey thanks basketball4ever for explainin what it all does in detail, made it clearer for me. I figured that part out, but i wanted to incorporate it into font.draw . I used that with font.draw and it worked, except the only thing is, is that the letters arent all evenly spaced between eachother, some have larger and some r smaller
basketball4ever




PostPosted: Sun Jan 30, 2005 2:13 pm   Post subject: (No subject)

mike200015 wrote:
hey thanks basketball4ever for explainin what it all does in detail, made it clearer for me. I figured that part out, but i wanted to incorporate it into font.draw . I used that with font.draw and it worked, except the only thing is, is that the letters arent all evenly spaced between eachother, some have larger and some r smaller


don't think you can actually do that... since each chracter for Font.Draw is measured in pixels... its hard to impossible. Unless you code each and everyone individually so that it appears after the delay... its hard m8.
mike200015




PostPosted: Sun Jan 30, 2005 2:45 pm   Post subject: (No subject)

yea that would be really anoying. o well. thanx anyway
Cervantes




PostPosted: Sun Jan 30, 2005 2:49 pm   Post subject: (No subject)

Turing:

var font : int := Font.New ("ROCKWELL:12:BOLD")
var word := "Hello World"
var x := 50
for i : 1 .. length (word)
    Font.Draw (word (i), x, 50, font, green)
    x += Font.Width (word (i), font)
    delay (100)
end for
Font.Free (font)
mike200015




PostPosted: Sun Jan 30, 2005 2:55 pm   Post subject: (No subject)

Cervantes wrote:
Turing:

var font : int := Font.New ("ROCKWELL:12:BOLD")
var word := "Hello World"
var x := 50
for i : 1 .. length (word)
    Font.Draw (word (i), x, 50, font, green)
    x += Font.Width (word (i), font)
    delay (100)
end for
Font.Free (font)

That worked! thanx! what does the code mean tho, can u explain like wat each thing is tho if you dont mind.
Cervantes




PostPosted: Sun Jan 30, 2005 3:13 pm   Post subject: (No subject)

Okay, the first three lines are simply variable declarations. You've already seen the first two. The third (x) is a variable that will store the x location that we are drawing our text at.
The for loop, you've seen. The Font.Draw, you've seen. Notice, however, that I'm drawing the string at the variable x. So, in order to move where we draw the string, we need to change x. We do that in the next line. And all we do is increase x by the width of the character that we just drew. Thus, the next time we use x, we'll be drawing at the end of the previous character, or the first blank spot.
It shouldn't be that difficult to understand, if you know what Font.Width does. If you don't, read the turing help file (press F9).
-Cervantes
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  [ 14 Posts ]
Jump to:   


Style:  
Search: