--LuaPlayer Euphoria IntraFont Sample

--#Create a color for the backGround
backGround = Color.new(255, 255, 255)

--#Declare colors to make it easier to use them (intraFont)
black = 0
lightGrey = 5

--#Initialize IntraFont
IntraFont.init()

--#Load a pgf Font
font = IntraFont.load("font.pgf")

--#Make the text print with a "Shadow" effect
function printShadowed(font, x, y, textSize, color, text)
	IntraFont.print(font, x + 1, y + 1, textSize, lightGrey, text)
	IntraFont.print(font, x, y, textSize, color, text)
end

--//## MAIN ##\\ --

while not Controls.read():start() do

	--Initialize the GU (Note : Any graphical functions MUST be placed AFTER this)
	System.draw()
	
	--Clear the screen
	screen:clear()
	
	--Make the screen White
	screen:fillRect(0, 0, 480, 272, backGround)
	
	--Print some text using intraFont and the shadow effect function
	printShadowed(font, 97.0, 50.0, 0.6, black, "LuaPlayer Euphoria V3 \n\n       Intra Font Sample")
	printShadowed(font, 25.0, 200.0, 0.6, black, "Official Forums : www.retroemu.com")
	
	--Wait for vsync
	screen.waitVblankStart()
	
	--Finish the GU and Sync
	System.endDraw()
	--Show the FPS (Note : MUST be called after System.endDraw()
	System.showFPS()
	screen.flip()
end

--Unload the font
IntraFont.unLoad(font)
System.quit() -- Quit the application after the main loop breaks
