Leute warum packt ihr das immer unter "loadMap" ?? Bei genauem lesen sollte man doch schon stutzig werden!
vllt so in der Art? Ist ein kleiner Auszug aus meinem HUD:
[lua]
--
-- InformationHUD
-- Specialization for an extra HUD
--
-- @author: FIAT80-90DT
-- @date: 04/02/11
-- @version: v1.0
-- @history: v1.0
InfomationHUD = {};
function InfomationHUD.prerequisitesPresent(specializations)
return true;
end;
function InfomationHUD:load(xmlFile)
self.HUD = {};
self.HUD.xPos = Utils.getNoNil(getXMLFloat(xmlFile, "vehicle.HUD#posX"), 0.770);
self.HUD.yPos = Utils.getNoNil(getXMLFloat(xmlFile, "vehicle.HUD#posY"),0.35);
self.HUD.width = Utils.getNoNil(getXMLFloat(xmlFile, "vehicle.HUD#width"),0.26);
self.HUD.height = Utils.getNoNil(getXMLFloat(xmlFile, "vehicle.HUD#height"),0.55);
self.HUDOverlay = Overlay:new("hudHUDOverlay", Utils.getFilename("DEIN_HUD.png", self.baseDirectory), self.HUD.xPos, self.HUD.yPos, self.HUD.width, self.HUD.height);
self.HUDisOn = true;
--self.keyType = InputBinding.getKeyNamesOfDigitalAction;
end;
function InfomationHUD:delete()
end;
function InfomationHUD:readStream(streamId, connection)
end;
function InfomationHUD:writeStream(streamId, connection)
end;
function InfomationHUD:mouseEvent(posX, posY, isDown, isUp, button)
end;
function InfomationHUD:keyEvent(unicode, sym, modifier, isDown)
end;
function InfomationHUD:update(dt)
if self:getIsActiveForInput() then
if InputBinding.hasEvent(InputBinding.TURN_HUD) then
self.HUDisOn = not self.HUDisOn;
end;
end;
end;
function InfomationHUD:updateTick(dt)
end;
function InfomationHUD:draw()
if self.isEntered and self:getIsActiveForInput() then
if self.HUDisOn then
renderText(0.835, 0.610, 0.021, "Works gut");
self.HUDOverlay:render();
end;
end;
end;
[/lua]
Die größe kann(muss aber nicht) in der xml angepasst werden