Experience percent bar
From VbGORE Visual Basic Online RPG Engine
Contents |
Introduction
This little code will add an EXP bar with numbers. You can have it placed anywhere you want it to be.
Add this code
Open GameClient.vbp.
Find this sub in the TileEngine.bas:
<vb>Private Sub Engine_Render_GUI_Window(ByVal WindowIndex As Byte)</vb>
In this case statement:
<vb>Select Case WindowIndex
Case YourWindow ---> Add here the following ...
</vb>
YourWindow is the window where you wish to place the Experience bar.
E.g.:
The ones highlighted in blue are 2 windows. The code goes after the: <vb>Case Window
With GameWindow.Window</vb>
Add the following lines for EXP bar:
<vb> Engine_Render_Rectangle .Screen.X + 48, .Screen.Y + 83, (BaseStats(SID.EXP) / BaseStats(SID.ELU)) * 141, 11, 1, 1, 1, 1, 1, 1, 0, 0, ExpColor, ExpColor, ExpColor, ExpColor, 0, False Engine_Render_Text Font_Default, BaseStats(SID.EXP) & "/" & BaseStats(SID.ELU), .Screen.X, .Screen.Y + 81, -1 </vb>
Where YourWindow is the name of the window that you want to edit. Where ExpColor is, you will want to specify the color you wish to use in ARGB format. This value can be acquired with the function D3DColorARGB().
Explanation
<vb> .Screen.X .Screen.Y </vb>
These are the coordinates of the object on the screen. .Screen.X is the horizontal positioning, while .Screen.Y is the vertical positioning.
<vb>.Screen.X + 48</vb> Since .Screen.X is referring to the horizontal position of the window, we must add( if you subtract the object will appear left of the window) to it. <vb>.Screen.Y + 83</vb> This is the same as above only this is vertical positioning, the more you add the more down the object is positioned, while when you subtract it will go up( subtracting will lead to the object appearing above the window).