Computer Science Canada

Text Effects

Author:  ior [ Mon Jan 17, 2005 11:07 pm ]
Post subject:  Text Effects

Just some text effects I picked up from this site.. Thought I'd gather them up and attempt to explain them Neutral

code:

var count : int := 0
var hor, vert : int := 1
var col : int := 16
var word := "HELP!"
colorback (255)
cls
%Beginning the fade in on it's own line...
loop            %This loop is for the first "HELP!" it fades in more on each line
col := col +1   %This is stating that the colour number increases everytime it loops by 1
color (col)     %This is stating that the colour is the variable "col"
put "HELP!"     %Putting "HELP!"
delay (100)     %Delaying between each time it puts help
exit when col = 31  %Making it exit when "col" reaches a loop of 31 times (color = white)
end loop
locate (10,10)  %Locating where the cursor will ask for your input
Input.Pause     %Asking user for input
%Beginning the fade in
loop            %Beginning the fade in loop
count := count +1   %Starting count again.. I'm using this so I can tell the loop to exit
for a : 16..31  %Colour fade.. 16 being dark grey, 31 being white.. Counting
    color (a)   %Stating that the colour is a count up from 16 to 31
    locate (1,10)   %Locating where I want it to output
    put "HELP!" %Self explanitory (sp?)
    delay (100) %Delaying between each... Darker colour
end for
exit when count = 1 %Exiting when it does it once.. YOu can change it to do it as many times as you like
end loop       
locate (10,10) 
Input.Pause
%The letter one... (Couldn't call it a name..)
for i : 1..5    %Setting the I value to count 1 to 5 (number of characters in HELP!)   
locate (1, 20)  %Locating where to put it
    put word (i)    %Putting the word.. And telling it that it's 5 characters
    delay (100) %Delaying between each letter
end for
locate (10,10)
Input.Pause
%The "typewriter" text effect
for b : 1 .. length (word)  %Setting value of B 1 to the amount of characters in var "word" which is HELP!
    locate (1,b + 30)   %Locating where you want it to output +30 because the B value is 1 - length...
    put word (b) ..     
    delay (100)     %Delay between each letter
end for   


-ior

Author:  cycro1234 [ Mon Jan 24, 2005 7:05 pm ]
Post subject: 

Wow! That's kool, I like that. Thx Smile

Author:  ste_louis26 [ Fri Jan 28, 2005 7:29 pm ]
Post subject: 

The dimming was kinda neat

Author:  Cervantes [ Fri Jan 28, 2005 8:28 pm ]
Post subject: 

The "dimming" effect works better if you use RGB. It works decently in this case, but it can only be done with white to black or black to white. You won't get a very large range on any other colours.
Turing:

colourback (black)
cls
var fontID := Font.New ("Times New Roman:148")
for i : 1 .. 200
    RGB.SetColour (0, i / 600, i / 400, i / 200) %plus, you can get any colour you want
    Font.Draw ("Hello", 100, 100, fontID, 0)
    delay (10)
end for
Font.Free (fontID)


: