Hugos Posted November 9, 2019 Posted November 9, 2019 Tell me, are there options for animations such as smooth appearance or fading? (These are Animations that are NOT driven by type "Linear," InQuad, "etc.)?
Addlibs Posted November 10, 2019 Posted November 10, 2019 (edited) Most animations are driven by an easing function - the simplest of which is Linear, but you could write your own easing equation - for example, y = x+math.sin(6.29x) if you want to, but most likely you won't need it. If you want something to appear smoothinly, use the return of an easing function as the alpha parameter; if you want it to slide onto the screen, use it for x or y position. Edited November 10, 2019 by MrTasty 1
Hugos Posted November 10, 2019 Author Posted November 10, 2019 3 hours ago, MrTasty said: Most animations are driven by an easing function - the simplest of which is Linear, but you could write your own easing equation - for example, y = x+math.sin(6.29x) if you want to, but most likely you won't need it. If you want something to appear smoothinly, use the return of an easing function as the alpha parameter; if you want it to slide onto the screen, use it for x or y position. Oh, right! Thanks)) And how I didn 't think of it.
Hugos Posted November 10, 2019 Author Posted November 10, 2019 Help! I can 't understand how to set up "guiSetAlpha" with "getTickCount."
Overkillz Posted November 10, 2019 Posted November 10, 2019 local yourtick = getTickCount() local alpha = 0 function yourFunctionRendering() local progresstick = getTickCount() - yourtick local progress = progresstick/500 if progress >= 1 then progress = 1 end alpha = interpolateBetween(0,0,0,1,0,0,progress,"Linear") --NOW YOUR FUNCTION guiSetAlpha ( yourWindow, alpha ) end addEventHandler("onClientRender",root,yourFunctionRendering) Something like this. Remember that eachtime you need to update the animation you have to restart 'yourtick' And deal with the condition to fadeout. I've just give you an example of fadein without the condition. Regards. 1
Hugos Posted November 11, 2019 Author Posted November 11, 2019 9 hours ago, Overkillz said: local yourtick = getTickCount() local alpha = 0 function yourFunctionRendering() local progresstick = getTickCount() - yourtick local progress = progresstick/500 if progress >= 1 then progress = 1 end alpha = interpolateBetween(0,0,0,1,0,0,progress,"Linear") --NOW YOUR FUNCTION guiSetAlpha ( yourWindow, alpha ) end addEventHandler("onClientRender",root,yourFunctionRendering) Something like this. Remember that eachtime you need to update the animation you have to restart 'yourtick' And deal with the condition to fadeout. I've just give you an example of fadein without the condition. Regards. Thanks!
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