--------------------------------------------------- 
-- FBA Tutorials
--
-- Tutorial / 09 / The Matrix Effect
--
--------------------------------------------------- 
--
-- Show a "matrix" effect with a graphic font
--
--------------------------------------------------- 

-- include an external script file with some useful functions
include("matrix.fba")

-- load our graphic font in slot 0
-- the gfx fonts are .png files with following format:
-- first line: contains the charset delimiters
-- other lines: contains the charset data
--
--
image=loadimage("fonts.png")

-- you could also use: 
-- loadgfxfont(slotindex, imagesindex, charset, chars_space)
-- to force load inside slotindex
--
local fontindex = loadgfxfont(image, "01ABCDEFGHIL", 3)

-- init letters matrix
InitMatrix()

function onmainloop()	
         clear(0,0,0)
         DrawMatrix(fontindex)
         
         -- exit if mouse is clicked
         if (mousedown() > 0) then
            quit()
         end
end
