
-----------------------------------
mike200015
Sun Jan 30, 2005 12:26 am

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..

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??

-----------------------------------
Mr. T
Sun Jan 30, 2005 12:31 am


-----------------------------------
Hello, Mike! It's Alex.

The answer do you question is...

DO IT YOURSELF!

no autographs, please

-----------------------------------
mike200015
Sun Jan 30, 2005 12:49 am


-----------------------------------
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
Sun Jan 30, 2005 1:03 am


-----------------------------------
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
Sun Jan 30, 2005 1:34 am


-----------------------------------

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
Sun Jan 30, 2005 8:41 am


-----------------------------------
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
Sun Jan 30, 2005 11:54 am


-----------------------------------

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
Sun Jan 30, 2005 1:32 pm


-----------------------------------
Another way to do it, not using Font.Draw
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 :).

-----------------------------------
mike200015
Sun Jan 30, 2005 1:39 pm


-----------------------------------
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
Sun Jan 30, 2005 2:13 pm


-----------------------------------
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
Sun Jan 30, 2005 2:45 pm


-----------------------------------
yea that would be really anoying. o well. thanx anyway

-----------------------------------
Cervantes
Sun Jan 30, 2005 2:49 pm


-----------------------------------

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
Sun Jan 30, 2005 2:55 pm


-----------------------------------

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
Sun Jan 30, 2005 3:13 pm


-----------------------------------
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
