Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Make Circular HP/MP Gauge [By: MrMiguu]


mrmiguu
 Share

Recommended Posts

::EDIT:: DONE!

Fairly easy to do, but slightly difficult to understand.

:::::::::::::::::
:: Resources ::
:::::::::::::::::
Empty Gauge:
![](http://i2.photobucket.com/albums/y23/Alexanderthegreat91/EmptyGauge.jpg)
HP Gauge:
![](http://i2.photobucket.com/albums/y23/Alexanderthegreat91/MPGauge.jpg)
MP Gauge:
![](http://i2.photobucket.com/albums/y23/Alexanderthegreat91/HPGauge.jpg)

:::::::::::::
:: Step 1 ::
:::::::::::::

* In your client, search **_If LCase$(casestring) = "playerhp" Then_**
* Add this line right below that: **_Dim AvgHP As Long_**
* Delete this line: **_frmMirage.shpHP.Width = ((GetPlayerHP(MyIndex)) / (GetPlayerMaxHP(MyIndex))) * 150_**

:::::::::::::
:: Step 2 ::
:::::::::::::

* Add this code in place of where the line you deleted was:

```
AvgHP = Int((GetPlayerHP(MyIndex) / GetPlayerMaxHP(MyIndex)) * 64)
frmMirage.picHPFrame.Height = AvgHP
frmMirage.picHPFrame.Top = (488 + 64) - AvgHP
frmMirage.imgHP.Top = AvgHP - 64
```

* In the same Module, find **_If casestring = "playermp" Then_**
* Add this right below that: **_Dim AvgMP As Long_**
* Delete this line: **_frmMirage.shpMP.Width = ((GetPlayerMP(MyIndex)) / (GetPlayerMaxMP(MyIndex))) * 150_**

* On the line where you just deleted that code, add this:

```
AvgMP = Int((GetPlayerMP(MyIndex) / GetPlayerMaxMP(MyIndex)) * 64)
frmMirage.picMPFrame.Height = AvgMP
frmMirage.picMPFrame.Top = (488 + 64) - AvgMP
frmMirage.imgMP.Top = AvgMP - 64
```

* Find **_Sub GameInit()_** and delete these 2 lines: **_frmMirage.shpHP.Width = ((GetPlayerHP(MyIndex)) / (GetPlayerMaxHP(MyIndex))) * 150_**
and
**_frmMirage.shpMP.Width = ((GetPlayerMP(MyIndex)) / (GetPlayerMaxMP(MyIndex))) * 150_**
* In place of where this line was: **_frmMirage.shpHP.Width = ((GetPlayerHP(MyIndex)) / (GetPlayerMaxHP(MyIndex))) * 150_**, place this code:

```
Dim AvgHP As Long
AvgHP = Int((GetPlayerHP(MyIndex) / GetPlayerMaxHP(MyIndex)) * 64)
frmMirage.picHPFrame.Height = AvgHP
frmMirage.picHPFrame.Top = (488 - 64) + AvgHP
frmMirage.imgHP.Top = AvgHP - 64
```

* In place of where this line was: **_frmMirage.shpMP.Width = ((GetPlayerMP(MyIndex)) / (GetPlayerMaxMP(MyIndex))) * 150_**, place this code:

```
Dim AvgMP As Long
AvgMP = Int((GetPlayerMP(MyIndex) / GetPlayerMaxHP(MyIndex)) * 64)
frmMirage.picMPFrame.Height = AvgMP
frmMirage.picMPFrame.Top = (488 - 64) + AvgMP
frmMirage.imgMP.Top = AvgMP - 64
```
:::::::::::::
:: Step 3 :: - Visual Section
:::::::::::::
Open your **_frmMirage_** and locate your **_shpHP_**, **_shpMP_**, and **_shpTNL_** objects:
![](http://i2.photobucket.com/albums/y23/Alexanderthegreat91/gaugeex_1.png)

Next, delete: **_shpHP_** and **_shpMP_**

Next, make: [2] x images (do not need names) and set their _Picture_ to the 'Empty Gauge' file (located in Resources; above. [2] x Picture boxes named **_picHPFrame_** and **_picMPFrame_**. Lastly, make 2 Images (one per picture box) inside of **_picHPFrame_** and **_picMPFrame_** named **_imgHP_** and **_imgMP_**, set their _Picture_ to the 'HP Gauge' and 'MP Gauge' located above in the Resources section:
**MAKE THEM ALL 64X64 IN SIZE AND PLACE THEIR .TOP AXIS AT 488!**
![](http://i2.photobucket.com/albums/y23/Alexanderthegreat91/gaugeex_2.png)

**LASTLY, MAKE SURE YOUR frmMirage IS SET TO _ScaleMode = 3 - Pixel_**
Link to comment
Share on other sites

im trying to work this out in my source, but the HP and MP declines from down to up instead of up to down.  hopefully when MrMiguu finishes this i will get it to work.

EDIT: and wouldn't you need to change the * 64 to whatever dimensions the image is?  like a 96x96 or something?
Link to comment
Share on other sites

you should also put in there if they have different image dimensions, they should change the 64 from whatever size dimension their image is, but it MUST be a fixed dimension like 96x96 or something.
Link to comment
Share on other sites

look what the codes do to my images:

[![](http://img188.imageshack.us/img188/1061/screenshot2r.png)](http://img188.imageshack.us/i/screenshot2r.png/)

i have no clue whats wrong, my image dimensions are 95x95, any idea whats up with this?
Link to comment
Share on other sites

circular just means HP/MP in a bubble, sphere, whatever you want to call it.

for some reason the HP and MP bubbles are going all over my screen for some reason.  MrMiguu should answer this when he comes back on.
Link to comment
Share on other sites

@MrMiguuâ„¢:

> You guys have to make sure you have the imgHP inside the picHPFrame so it can move around inside of it.

Obviously I've got all that sorted out, it just gives a very ugly black area around the circle covering up the empty image when it goes down. :P
Link to comment
Share on other sites

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
 Share

×
×
  • Create New...