Keilbritschn Posted December 11, 2013 Share Posted December 11, 2013 Hey guys, i have a problem. I want, that the interpolateBetween counts if i press F6, but it counts if the Resource starts. local screenW,screenH = guiGetScreenSize() local state = "Login" local phase = 0 local lastTick = getTickCount() function setSettings( s, p ) state = s or 'Login' phase = p or 0 lastTick = getTickCount() end function getProgress( addtick ) local now = getTickCount() local elapsedTime = now - lastTick local duration = lastTick+addtick - lastTick local progress = elapsedTime / duration return progress end function drawInterface () local InterfaceBreite = interpolateBetween(0,0,0,250,250,250,getProgress(500),"InOutQuad") dxDrawRectangle ( 0, 0, InterfaceBreite, screenH, tocolor ( 23, 23, 23, 255 ) ) showChat(false) end function drawInterfaceRender ( ) addEventHandler("onClientRender", getRootElement(), drawInterface) end bindKey("F6","down",drawInterfaceRender) Link to comment
TAPL Posted December 11, 2013 Share Posted December 11, 2013 Try. local screenW,screenH = guiGetScreenSize() local state = "Login" local phase = 0 function setSettings( s, p ) state = s or 'Login' phase = p or 0 lastTick = getTickCount() end function getProgress( addtick ) local now = getTickCount() local elapsedTime = now - lastTick local duration = lastTick+addtick - lastTick local progress = elapsedTime / duration return progress end function drawInterface () local InterfaceBreite = interpolateBetween(0,0,0,250,250,250,getProgress(500),"InOutQuad") dxDrawRectangle ( 0, 0, InterfaceBreite, screenH, tocolor ( 23, 23, 23, 255 ) ) showChat(false) end function drawInterfaceRender ( ) lastTick = getTickCount() addEventHandler("onClientRender", getRootElement(), drawInterface) end bindKey("F6","down",drawInterfaceRender) Link to comment
Keilbritschn Posted December 12, 2013 Author Share Posted December 12, 2013 thanks a lot 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