# Progress bar in circle

## Recommended Posts

Hi guys.

Today i want to make a progress bar in circle. I try somethings with this : viewtopic.php?f=108&t=33342

I want to make a circle with life and armor ( or other else ranging from 0 to 100 ) like :

0 to 180° = life - who start at 0° ( counterclockwise of a watch )

0 to 180° = armor - who start at 0° ( clockwise )

But, what are calculation and image who i whould take to make it ?

I thinks it's a big question. Thanks all !

• Replies 68
• Created

#### Popular Days

```dxDrawCircle
```
```dxDrawCircle
```

With that you cant draw a part of the circle.

in this time not.

I am in dispositive mobile

Not a rectangle i want to make a circle progress bar

Use dxDrawCircle and mess with radius and other parameters

dxDrawCircle( 200, 200, 50, 5, 1, 0, 0,360)

I do That :

```    local hpMin = 176
local hpMax = 135
local hpRate = hpMin-hpMax
local hp = hpMin-((getElementHealth(getLocalPlayer())*hpRate)/100)
dxDrawCircle( 220,796,110, 15,0.01,hp,hpMin,tocolor(255,0,0,255))
```

I do That :
```local hpMin = 176
local hpMax = 135
local hpRate = hpMin-hpMax
local hp = hpMin-((getElementHealth(getLocalPlayer())*hpRate)/100)
dxDrawCircle( 220,796,110, 15,0.01,hp,hpMin,tocolor(255,0,0,255))
```

gave right?

Look, nice very, congratulations

Thanks but at 1HP the progress bar isn't correct. Look.

Thanks but at 1HP the progress bar isn't correct. Look.

any errors in debug?

try this

```local hp = hpMin-getElementHealth(getLocalPlayer())*hpRate
```

Thanks but at 1HP the progress bar isn't correct. Look.

try this

```local hp = hpMin-getElementHealth(getLocalPlayer())*hpRate
```

Wrong

No errors.

```    dxDrawCircle( 220,796,110, 15,0.01,hp,hpMin,tocolor(255,0,0,255))
```

But no change.

try this, value 15 for 1

```
-- 220,796,110, 15, 0.01
dxDrawCircle( 220,796,110, 1,0.01,hp,hpMin,tocolor(255,0,0,255))
```

sorry my friend, more I'm not able to test here, I am without desktop

I dont understand what do you want to do.

With function draw circle, there is a loss of FPS ( 3 to 5 ) it's not possible to use this...

I dont understand what do you want to do.

I am unable to test. only this

try this, value 15 for 1
```
-- 220,796,110, 15, 0.01
dxDrawCircle( 220,796,110, 1,0.01,hp,hpMin,tocolor(255,0,0,255))
```

It reduce the width of the circle.

## Create an account

Register a new account