Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- InfoWindow={}
- function InfoWindow:create(text,timeOut)
- local object={
- element=createElement("genisys-infoBox"),
- text=text,
- relative=relative or false,
- color={25,25,25},
- alpha=220,
- draw=self.draw,
- visible=true,
- enabled=true,
- fontSize=1,
- font="pricedown",
- text=text,
- fading=false
- }
- addGlobalFunctions(object)
- genisysGUIObjects[object.element]=object
- setTimer(function(object) if object==nil then return end object.fading=true genisysGUIObjects[object.element]=object end,timeOut or 5000,1,object)
- return object
- end
- function drawGenisysInfoWindows()
- local infoBoxes=getElementsByType("genisys-infoBox")
- for i,infoBox in pairs(infoBoxes) do
- local object=genisysGUIObjects[infoBox]
- if object.visible~=false then
- local color=object.color
- if object.fading==true then
- object.alpha=object.alpha-1
- if object.alpha==0 then
- destroyElement(object.element)
- object=nil
- end
- end
- if object~=nil then
- dxDrawRectangle(screenx*0.05,screeny*0.05+(i-1)*screeny*0.14,screenx*0.15,screeny*0.13,tocolor(color[1],color[2],color[3],object.alpha),false)
- dxDrawText(object.text,screenx*0.05,screeny*0.05+(i-1)*screeny*0.14,screenx*0.15,screeny*0.13+(i-1)*screeny*0.14,tocolor(255,255,255,object.alpha+25),object.fontSize,object.font,"left","top",true,true)
- end
- end
- end
- end
- addEventHandler("onClientRender",getRootElement(),drawGenisysInfoWindows)
- local infoWindow=InfoWindow:create("Welcome to Project Genisys, Enjoy your stay!",7000)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement