Nexious Posted September 6, 2017 Author Share Posted September 6, 2017 Can someone help me understand how the ingame hp bar mp bar exp bar n hotkey bar and buttons and everything can be moved the positions. Link to comment Share on other sites More sharing options...
Mohenjo Daro Posted September 6, 2017 Share Posted September 6, 2017 Which engine are you using? Link to comment Share on other sites More sharing options...
SolidLink Posted September 6, 2017 Share Posted September 6, 2017 try theseSub handleKeyPressSub DrawGUIbarSub DrawGUISub DrawHotbarSub DrawTextSubDrawCharacterSub DrawNPCSub DrawPlayerSub InitiliaseGUItry these, you can modify the GUI x,y on these sub and can also other gfx stuff like player frames, hotbar position etc Link to comment Share on other sites More sharing options...
Nexious Posted September 7, 2017 Author Share Posted September 7, 2017 @mohenjo-daro ER 1.8 Link to comment Share on other sites More sharing options...
Mohenjo Daro Posted September 7, 2017 Share Posted September 7, 2017 Install vb6 (you can't use visual studios) and go to "Public Sub GuiLocation()"All the locations are in that sub. Link to comment Share on other sites More sharing options...
Nexious Posted September 7, 2017 Author Share Posted September 7, 2017 @solidlink need abit more detail thanks Link to comment Share on other sites More sharing options...
Nexious Posted September 7, 2017 Author Share Posted September 7, 2017 @mohenjo-daro can u give me an example of how to move the GUI Link to comment Share on other sites More sharing options...
Mohenjo Daro Posted September 7, 2017 Share Posted September 7, 2017 If you want to move the bars (hp, exp, mp, gold, etc.) then you go to GUILocation() and change these 2 lines 'Stats GUI(GUI_STATS).X = 0 GUI(GUI_STATS).Y = 0Those will change the bar area position. Link to comment Share on other sites More sharing options...
Mohenjo Daro Posted September 7, 2017 Share Posted September 7, 2017 That's an easy to understand part of the code. A more complicated part is ' Shop GUI(GUI_SHOP).X = (frmMain.ScaleWidth - GUI(GUI_SHOP).Width) * 0.5 GUI(GUI_SHOP).Y = (frmMain.ScaleHeight - GUI(GUI_SHOP).Height) * 0.5This code will place the shop menu in the center of the screen. It gets the form size and the menu and centers them ( X/2 - Y/2 = c[X - Y] / 2 which will center)*** ' Options GUI(GUI_OPTIONS).X = frmMain.ScaleWidth - 232 GUI(GUI_OPTIONS).Y = frmMain.ScaleHeight - GUI(GUI_OPTIONS).Height - (frmMain.ScaleHeight - BTN(1).Y + btnOffset)This code will make sure the option menu is always in the lower right corner of the screen. 232 is the option menu width and offset from the side of the screen.BTN(1).Y is in that code to keep your menus above your buttons so that you don't have a menu blocking you from clicking a button). The offset is to keep the menus slightly above your buttons.***Thanks to deminizer for asking me to explain these to him in chat, showed me I should explain them instead of saying where to look :) Link to comment Share on other sites More sharing options...
Nexious Posted September 7, 2017 Author Share Posted September 7, 2017 Thx so much now i've got it Link to comment Share on other sites More sharing options...
Mohenjo Daro Posted September 7, 2017 Share Posted September 7, 2017 No problem :)To change the button locations ' Loop through the locations For i = btnCount To 1 Step -1 ' Rows are done in order, columns are reversed: enum order is right to left and top to bottom If i = btnCount Then BTN(btnEnabled(i)).X = frmMain.ScaleWidth - BTN(btnEnabled(i)).Width - btnOffset Else If btnCount - i <= (btnCount / rows) * (tempRows + 1) Then BTN(btnEnabled(i)).X = BTN(btnEnabled(i + 1)).X - BTN(btnEnabled(i)).Width - btnOffset Else BTN(btnEnabled(i)).X = frmMain.ScaleWidth - BTN(btnEnabled(i)).Width - btnOffset tempRows = tempRows + 1 End If End If BTN(btnEnabled(i)).Y = frmMain.ScaleHeight - BTN(btnEnabled(i)).Height - btnOffset - ((tempRows) * (BTN(btnEnabled(i)).Height + btnOffset)) NextThis sub is in GUILoction as well. This will align the buttons to the lower right corner. The button sizes can be changed, but I suggest making them all similar heights (they use the current button height when placing the rows/assigning heights). Link to comment Share on other sites More sharing options...
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