DarkByte Posted June 30, 2016 Share Posted June 30, 2016 (edited) Hello i wonder if it's possible to draw an animated bar, like decreasing slowly to the value and stop at the needed point and increasing slowly to the needed point, if so please show an example i have no idea how to do it.. Edited July 7, 2016 by Guest Link to comment
فاّرس Posted June 30, 2016 Share Posted June 30, 2016 Do you mean this? https://wiki.multitheftauto.com/wiki/dxDrawLoading Link to comment
DarkByte Posted June 30, 2016 Author Share Posted June 30, 2016 Yes that's it but when I'm restarting resource the bar grows, but it doesn't decrease, it's like dxDrawRectangle after loading. Link to comment
_DrXenon Posted June 30, 2016 Share Posted June 30, 2016 local width = 0 dxDrawRectangle(x,y,width,height,...) setTimer(function() Width = width + 1 ,100,20) Not tested, but this is the idea, you create a rectangle with the width as a var and you later change the var with a timer or onClientRender to have a smooth grow on the rectangle Link to comment
DarkByte Posted July 1, 2016 Author Share Posted July 1, 2016 No, you don't understand me, the script it's fine but it doesn't decrease. Link to comment
DarkByte Posted July 1, 2016 Author Share Posted July 1, 2016 Well, i did this and everything works. Only grows and then then everything it's normal it doesn't decrease. local healthStat = interpolateBetween(0,0,0,healthStat,0,0, (now - start) / ((start + 5000) - start), "OutQuad") Halp? Link to comment
_DrXenon Posted July 1, 2016 Share Posted July 1, 2016 No, you don't understand me, the script it's fine but it doesn't decrease. You are right, I don't understand you, And I don't know on which script you are talking about, therefore I can't help. Link to comment
DarkByte Posted July 1, 2016 Author Share Posted July 1, 2016 Well, i did this and everything works. Only grows and then then everything it's normal it doesn't decrease. local healthStat = interpolateBetween(0,0,0,healthStat,0,0, (now - start) / ((start + 5000) - start), "OutQuad") Halp? Link to comment
DarkByte Posted July 2, 2016 Author Share Posted July 2, 2016 The bar grows only up when i'm restarting the resource, after that it's like ordinary dxDrawRectangle but i want it to decrease and increase by the value given. 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