Keilbritschn Posted June 25, 2013 Share Posted June 25, 2013 Hey guys, i have a Problem. i wanted to try the interpolateBetween function. local screenx,screeny = guiGetScreenSize() -- animation local state = 'starting' local phase = 0 local alpha = 0 local lastTick = getTickCount() local function getProgress( addtick ) local now = getTickCount() local elapsedTime = now - lastTick local duration = lastTick+addtick - lastTick local progress = elapsedTime / duration return progress end local RectangleX,RectangleY = interpolateBetween(screenx/2-250, 0-screeny, 0, screenx/2-250, 0, 0, getProgress(10000), 'Linear') function draw() dxDrawRectangle(RectangleX, RectangleY, 500, screeny, tocolor(27, 122, 224, 255)) showCursor(false) end addEventHandler("onClientResourceStart",getRootElement(), draw) addEventHandler("onClientRender", root, draw) the server says no errors. But it dont do that, what i want to do Please help me Link to comment
ikzelf Posted June 25, 2013 Share Posted June 25, 2013 local screenx,screeny = guiGetScreenSize() -- animation local state = 'starting' local phase = 0 local alpha = 0 local lastTick = getTickCount() local function getProgress( addtick ) local now = getTickCount() local elapsedTime = now - lastTick local duration = lastTick+addtick - lastTick local progress = elapsedTime / duration return progress end function draw() local RectangleX,RectangleY = interpolateBetween(screenx/2-250, 0-screeny, 0, screenx/2-250, 0, 0, getProgress(10000), 'Linear') dxDrawRectangle(RectangleX, RectangleY, 500, screeny, tocolor(27, 122, 224, 255)) showCursor(false) end addEventHandler("onClientRender", root, draw) Link to comment
Castillo Posted June 25, 2013 Share Posted June 25, 2013 You should explain him what he did wrong, would be a lot more helpful for him. 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