Jump to content

.


DarkByte

Recommended Posts

Posted (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 by Guest
Posted

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

Posted

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?

Posted
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.

Posted
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?

Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...