'~DaLesTe^' Posted June 25, 2015 Share Posted June 25, 2015 How can I make the dwDraw to move from its starting point to the other side of the screen ? local x,y = guiGetScreenSize() local admin = "" local mensagem = "" local iv = false local ATIVADO = false a1 = 200 a2 = 255 local lastColorChange = getTickCount ( ); local color = 1; addEvent("show", true) function mostrar(player, msg) lastColorChange = getTickCount ( ); lastColor = 1; mensagem = msg admin = player ATIVADO = true a1 = 200 a2 = 255 if (isTimer(timer1)) then killTimer(timer1) end timer1 = setTimer(function() setTimer(function() if a1 > 0 then a1 = a1 - 5 end if a2 > 0 then a2 = a2 - 5 end if a1 <= 0 and a2 <= 0 then ATIVADO = false admin = "" mensagem = "" end end, 50, 53) end, 6000, 1) end addEventHandler("show", getRootElement(), mostrar) function drawStuff() if (ATIVADO == true) then if ( getTickCount() - lastColorChange >= 2000 ) then lastColorChange = getTickCount ( ); if ( lastColor == 1 ) then lastColor = 2; else lastColor = 1; end end if ( lastColor == 1 ) then dxDrawRectangle ( x/40, y/2.8, x/3, y/5, tocolor ( 87, 27, 239, a1 ) ) dxDrawRectangle ( x/40, y/2.8, x/3, y/30, tocolor ( 0, 43, 65, a2) ) else dxDrawRectangle ( x/40, y/2.8, x/3, y/5, tocolor ( 0, 0, 0, a1 ) ) dxDrawRectangle ( x/40, y/2.8, x/3, y/30, tocolor ( 0, 43, 80, a2) ) end dxDrawText (string.gsub ( admin, "#%x%x%x%x%x%x", "" ), x/35, y/1.42, x/4.6, y/25, tocolor ( 0, 0, 0, 255 ), 1, "sans", "center", "center", false, false, false, false) dxDrawText (string.gsub ( admin, "#%x%x%x%x%x%x%x%x", "" ), x/35, y/1.42, x/4.6, y/25, tocolor ( 255, 255, 255, 255 ), 1, "sans", "center", "center", false, false, false, true) dxDrawText ( mensagem, x/31, y/2.52, x/4.6, y/2.4, tocolor ( 100, 255, 129, 255 ), 0.0, "clear", "left", "top", true, true, false, false) dxDrawText ( mensagem, x/31, y/2.53, x/4.0, y/1.1, tocolor ( 100, 255, 129, 255 ), 1.2, "clear", "left", "top", true, true, false, false) end end addEventHandler("onClientRender", root, drawStuff) --By: Daleste Link to comment
novo Posted June 26, 2015 Share Posted June 26, 2015 You can use interpolateBetween or either change the position values manually. Here's an example. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now