
-----------------------------------
Mystify
Sat Dec 03, 2005 7:09 pm

Fading Text
-----------------------------------
Hey anyone know how to do fading text if so can you give me an example i cant figure it out????

-----------------------------------
Cervantes
Sat Dec 03, 2005 7:41 pm


-----------------------------------
You need to use the RGB module.

Turing Walkthrough -> RGB tutorial

-----------------------------------
DIIST
Sun Dec 04, 2005 1:56 pm

Fading Text
-----------------------------------
const numc:int:=10%Number of shades
var font1:=Font.New ("serif:30")

var C:array 0..numc of int%to hold the colour number


for assigncolor:0..numc
    C(assigncolor):=RGB.AddColor(assigncolor/numc,assigncolor/numc,assigncolor/numc)%Typical shades of black, you can change it to fit your taste by changint the red green and blue values 
end for

for fade:0..numc
    Font.Draw("example",50,50,font1,C(fade))
    delay(50)
end for 

Font.Free(font1)

Try this! This is how i ussually do it.

-----------------------------------
Cervantes
Sun Dec 04, 2005 3:26 pm


-----------------------------------
Ack!  Whitespace is your friend.

Also, if there's nothing more to this program that involves these particular colours, you don't need to store them in an array:


const numc := 100     %Number of shades
var font1 := Font.New ("serif:30")

for i : 0 .. numc
    RGB.SetColour (240, i / numc, i / numc, i / numc) %Typical shades of black
    Font.Draw ("example", 50, 50, font1, 240)          %Draw in colour # 240, which is the one we're modifying with RGB.SetColour
end for

Font.Free(font1) 

Untested

-----------------------------------
do_pete
Mon Dec 05, 2005 11:37 am


-----------------------------------
if your background is white or black you can do it this way which doesn't involve all that RGB stuff
var font : int := Font.New ("timesnewroman:24:bold")
var text : string := "Fading text done the easy way."
var x : int := 150
var y : int := 200
for decreasing c : 31 .. 16
    Font.Draw (text, x, y, font, c)
    delay (50)
end for
for c : 16 .. 31
    Font.Draw (text, x, y, font, c)
    delay (50)
end for
colourback (black)
cls
for c : 16 .. 31
    Font.Draw (text, x, y, font, c)
    delay (50)
end for
for decreasing c : 31 .. 16
    Font.Draw (text, x, y, font, c)
    delay (50)
end for

