local x,y = guiGetScreenSize()
local defScale = 1
local currentScale = defScale
local maxScale = 2
local step = 0.05 -- How fast to change the size
local turn = true -- true = increase size, false = decrease size
local text = "Loading next map"
local font = dxCreateFont("myFont.ttf",10)
function myClientFunction_Handler()
if turn == true then -- If we increase the value
currentScale = currentScale + step
if currentScale > maxScale then
currentScale = maxScale
turn = false -- Reached max? Then make it go back
end
else
currentScale = currentScale - step
if currentScale < defScale then
currentScale = defScale
turn = true
end
end
local width = dxGetTextWidth(text,currentScale,font)
local height = dxGetFontHeight(currentScale,font)
dxDrawText(text,x/2-width/2,y/2-height/2,width,height,tocolor(255,255,255,255),currentScale,font)
end
function AddingEvent()
addEventHandler("onClientRender",root,myClientFunction_Handler)
end
addEvent("myEvent", true)
addEventHandler("myEvent", getRootElement(), AddingEvent)