--
-- HUD
-- Specialization to toggle a HUD.
-- @uthor : Bayn - www.tsforum3.com
-- D@te : 27.07.2010
--
-- This script has been made under "OpenSource rules". 
-- That means you can use it without asking authorization, but also without forgetting to quote the author's name.

HUD = {};

function HUD.prerequisitesPresent(specializations)
    return true
end;

function HUD:load(xmlFile)

	self.HUDpath = Utils.getFilename("HUD_LexionHelp.png", self.baseDirectory);
	self.HUDWidth = 0.4-0.012;
    self.HUDHeight = 0.3;
	self.HUDPoxX = 0.012;
    self.HUDPoxY = 1-0.99;
    self.HUDOverlay = Overlay:new("HUD", self.HUDpath, self.HUDPoxX, self.HUDPoxY, self.HUDWidth, self.HUDHeight);
	
	self.HUD = false;
end;

function HUD:delete()
    if self.HUDOverlay ~= nil then
		self.HUDOverlay:delete();
	end;
end;

function HUD:mouseEvent(posX, posY, isDown, isUp, button)
end;

function HUD:keyEvent(unicode, sym, modifier, isDown)
end;

function HUD:update(dt)
    if self:getIsActiveForInput() then
		if InputBinding.hasEvent(InputBinding.BR16KHUD) then
			self.HUD = not self.HUD;
		end;
	end;
end;

function HUD:draw()  
		if self.HUDOverlay ~= nil then
			if self.HUD then
				self.HUDOverlay:render();
			end;
		end;
	g_currentMission:addExtraPrintText(string.format("Key %s: Info ein/aus", InputBinding.getKeyNamesOfDigitalAction(InputBinding.BR16KHUD)));

end;




