%%a basick string
var word := "W E L C O M E T O M O V I E T R I V I A"
%% the high of the next
var height := 24
%% this is the font for Font.Draw, see turing docs for more info
var font1 := Font.New ("raavi:" + intstr (height))
%% this finds the center of the screen minuse the width of the string, see Font.Width
var x := (maxx - Font.Width (word, font1)) div 2
%% this finds the center of the screen minuse the hight of the text
var y := (maxy - height) div 2
%% a for loop that will go once for each char in the string
for rep : 1 .. length (word)
%%bacik dealy
delay (100)
%%this draws a box from the vaule x and y (see above) to x plus the width
%%of the substrinng word(rep) and y. rep is the index of the for loop so every time
%%it runs it adds a char of the string word to the value. so the box gets biger
Draw.FillBox (x, y, x + Font.Width (word (rep), font1), y + height, black)
%%this wroks like the above where it uses substrings to draw more and more letters.
%%word(1) whould be "W", word(5) whoudl be "W E L" and so on.
%%so it draws one more char of the sting each time.
Font.Draw (word (rep), x, y, font1, 13)
%%this adds the length of the char that was added to x so the box will be biger next
%%time round
x += (Font.Width (word (rep), font1))
end for
|