hallo,
ich möchte die "stantard" vio infobox vergrösern, so das der text auch hinein passt, leider habe ich bisher kein erfolg gehabt, könnt ihr mir bitte helfen.
so sieht es momentan aus....öhmm ja momentan geht es garnicht, bis jetzt ging es
Lua
-------------------------
------- (c) 2010 --------
------- by Zipper -------
-- and Vio MTA:RL Crew --
-------------------------
gLabels = { }
local myFont = nil
function infobox ( text, tts, r, g, b )
infobox_start_func ( text, tts, r, g, b )
end
function showInfoText_func ()
if not gLabels["InfoTextForum"] and 1 > 2 then -- deaktiviert
gLabels["InfoTextForumShadow"] = guiCreateLabel(10, screenheight-20+1, screenwidth+1, screenheight,"Forum:"..forumURL..", Hilfemenue: F1, Karte: F11",false,getRootElement())
gLabels["InfoTextForum"] = guiCreateLabel(10, screenheight-20, screenwidth, screenheight,"Forum:"..forumURL..", Hilfemenue: F1, Karte: F11",false,getRootElement())
guiLabelSetColor(gLabels["InfoTextForum"],255,0,0)
guiLabelSetColor(gLabels["InfoTextForumShadow"],0,0,0)
guiSetFont(gLabels["InfoTextForum"],"default-bold-small")
guiSetFont(gLabels["InfoTextForumShadow"],"default-bold-small")
end
end
addEvent ( "showInfoText", true )
addEventHandler ( "showInfoText", getRootElement(), showInfoText_func )
function infobox_start_func ( text, timetoshow, r, g, b )
infoboxText = text
-- DEV --
while string.sub ( infoboxText, 1, 2 ) == "\n" do
infoboxText = string.sub ( infoboxText, 3, #infoboxText )
end
while string.sub ( infoboxText, #infoboxText-1, #infoboxText ) == "\n" do
infoboxText = string.sub ( infoboxText, 1, #infoboxText-2 )
end
-- DEV --
if r == nil then
r = 200
end
if g == nil then
g = 200
end
if b == nil then
b = 200
end
infoboxR = r
infoboxG = g
infoboxB = b
if isTimer ( ChatBoxTimer1 ) then
killTimer ( ChatBoxTimer1 )
-- killTimer ( ChatBoxTimer2 )
else
addEventHandler ( "onClientRender", getRootElement(), infoboxRender )
local sx, sy = guiGetScreenSize ()
sx = (sx/2)-(280/2)
sy = 5
-- infoboxIMG = guiCreateStaticImage(sx,sy,220,160,"images/colors/infobox.jpg",true)
-- guiSetAlpha(infoboxIMG, 0.85)
end
playSound ( "sounds/info.mp3") --sound beim anzeigen(by NoTUs)
ChatBoxTimer1 = setTimer ( removeInfoboxDraw, timetoshow, 1 )
-- ChatBoxTimer2 = setTimer ( destroyElement, timetoshow, 1, infoboxIMG )
end
addEvent ( "infobox_start", true )
addEventHandler ( "infobox_start", getRootElement(), infobox_start_func )
function removeInfoboxDraw ()
removeEventHandler ( "onClientRender", getRootElement(), infoboxRender )
end
function _CreateInfobox ()
--infoboxText = guiCreateTabPanel ( 3, 3, 135, 90, false )
infoboxText = guiCreateStaticImage ( 3, 3, 135, 90, "images/black.bmp", false )
infoboxTextLabel = guiCreateLabel ( 10,10,322,78,"", false )
guiLabelSetColor ( infoboxTextLabel, 255, 255, 125 )
guiSetAlpha ( infoboxText, 1 )
guiSetAlpha ( infoboxTextLabel, 1 )
guiSetVisible(infoboxText, false)
guiSetVisible(infoboxTextLabel, false)
guiSetFont ( infoboxTextLabel, "default-bold-small" )
end
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()),
function ()
_CreateInfobox()
end
)
function showDrawnText_func ( text, timeToShow, r, g, b )
curDrawedText = text
curDrawedTextR = tonumber ( r )
curDrawedTextG = tonumber ( g )
curDrawedTextB = tonumber ( b )
addEventHandler ( "onClientRender", getRootElement(), showDrawnText_render )
setTimer ( function () removeEventHandler ( "onClientRender", getRootElement(), showDrawnText_render ) end, timeToShow, 1 )
end
addEvent ( "showDrawnText", true )
addEventHandler ( "showDrawnText", getRootElement(), showDrawnText_func )
function showDrawnText_render ()
dxDrawText ( curDrawedText, screenwidth/2-3-200, screenheight/2-3, screenwidth, screenheight, tocolor ( 0, 0, 0, 255 ), 2.5, "pricedown" )
dxDrawText ( curDrawedText, screenwidth/2-200, screenheight/2, screenwidth, screenheight, tocolor ( curDrawedTextR, curDrawedTextG, curDrawedTextB, 255 ), 2.5, "pricedown" )
end
function infoboxRender ()
local sx, sy = guiGetScreenSize ()
sx = (sx/2)-(260/2)
sy = 5
--dxDrawImage(sx+1.5,sy+1.5,200,150, "images/colors/infobox.jpg", 0, 0, 0, tocolor(255, 255, 255, 255), true)
dxDrawRectangle(sx+1,5,sy+1.5,200,150, tocolor(0 ,0 ,0 , 83), true)
dxDrawText(infoboxText,sx+1.5,sy+1.5,200,150,tocolor(infoboxR,infoboxG,infoboxB,255),1.4,myFont,false,false,true)
end
myFont = dxCreateFont( "fonts/Antroposofia.ttf", 12 )
Alles anzeigen