vulcano Posted May 11, 2013 Author Share Posted May 11, 2013 How to I add buttons to GUII'm using Eclipse The Final Frontier and it dont have the friends/quest buttonsHow I can Add?Thanks! Link to comment Share on other sites More sharing options...
escfoe2 Posted May 11, 2013 Share Posted May 11, 2013 In modGraphics under Sub DrawGUI find```' render menu'If GUIWindow(GUI_MENU).Visible Then DrawMenu```Uncomment the If-Then Statement. Link to comment Share on other sites More sharing options...
vulcano Posted May 11, 2013 Author Share Posted May 11, 2013 I want to create more buttons![](http://www.freemmorpgmaker.com/uploadfiles/1f372fe337e0b0db62213e6468f80ad0.png)I want to create the friends, quests, and skills buttonsFor when you click each button, window appears them Link to comment Share on other sites More sharing options...
escfoe2 Posted May 11, 2013 Share Posted May 11, 2013 Well that requires a programmer to render the new buttons and add hover/click/normal button functionalities. Link to comment Share on other sites More sharing options...
vulcano Posted May 11, 2013 Author Share Posted May 11, 2013 How do I do that?Can u tell me how do I do that? Link to comment Share on other sites More sharing options...
Zeno Posted May 11, 2013 Share Posted May 11, 2013 Try searching for "buttons" in VB6 and seeing how they're done. You can mimic the code for new buttons. Link to comment Share on other sites More sharing options...
vulcano Posted May 11, 2013 Author Share Posted May 11, 2013 I've tried to do thisBut when you open the gameAppears error 9 Subscript out of range Link to comment Share on other sites More sharing options...
escfoe2 Posted May 11, 2013 Share Posted May 11, 2013 You can copy off of another Draw event such as the DrawMenu sub. I believe that's where the buttons are drawn. In Sub InitialiseGUI you need to add more button values at the bottom of the sub. Use the ones there as a reference. You'll have to add new button arrays. To do that search for MAX_BUTTONS and make sure it's equal to the same amount you used in InitialiseGUI. Ummm. New click events will be needed in HandleMouseDown and HandleMouseUp.This is just a quick jit of what you'll have to do. Link to comment Share on other sites More sharing options...
vulcano Posted May 11, 2013 Author Share Posted May 11, 2013 See if it's rightI click in the button and the friends list dont appearIn Sub DrawMenu I put:```' little friend button I = 56If Buttons(I).Visible Then ' set co-ordinate x = GUIWindow(GUI_MENU).x + Buttons(I).x y = GUIWindow(GUI_MENU).y + Buttons(I).y Width = Buttons(I).Width Height = Buttons(I).Height ' check for state If Buttons(I).state = 2 Then ' we're clicked boyo 'EngineRenderRectangle Tex_Buttons_c(Buttons(i).PicNum), x, y, 0, 0, width, height, width, height, width, height RenderTexture Tex_Buttons_c(Buttons(I).PicNum), x, y, 0, 0, Width, Height, Width, Height ElseIf (GlobalX >= x And GlobalX <= x + Buttons(I).Width) And (GlobalY >= y And GlobalY <= y + Buttons(I).Height) Then ' we're hoverin' 'EngineRenderRectangle Tex_Buttons_h(Buttons(i).PicNum), x, y, 0, 0, width, height, width, height, width, height RenderTexture Tex_Buttons_h(Buttons(I).PicNum), x, y, 0, 0, Width, Height, Width, Height ' play sound if needed If Not lastButtonSound = I Then PlaySound Sound_ButtonHover, -1, -1 lastButtonSound = I End If Else ' we're normal 'EngineRenderRectangle Tex_Buttons(Buttons(i).PicNum), x, y, 0, 0, width, height, width, height, width, height RenderTexture Tex_Buttons(Buttons(I).PicNum), x, y, 0, 0, Width, Height, Width, Height ' reset sound if needed If lastButtonSound = I Then lastButtonSound = 0 End IfEnd If```And in Sub initialisegui``` ' main - little friendWith Buttons(56) .state = 0 ' normal .x = 30 .y = 5 .Width = 69 .Height = 29 .Visible = True .PicNum = 27End With```In MAX_BUTTONS```Public Const MAX_BUTTONS As Long = 56```In HandleMouseUp``` Case GUI_FRIENDS Buddies_MouseUp mouseClicked = False```In HandleMouseDown``` Case GUI_FRIENDS Buddies_MouseDown mouseState = GUI_FRIENDS If Button = vbRightButton Then mouseClicked = True```What's wrong? Link to comment Share on other sites More sharing options...
Zeno Posted May 11, 2013 Share Posted May 11, 2013 You're almost there! ![:D](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/biggrin.png)What you've added into HandleMouseUp and Down are to add mouse functionality _within_ GUI_FRIENDS, not to bring it up. You'll probably want to to include this, but for now one thing at a time! Because the buttons will be in GUI_MAIN which already had mouse support, you didn't have to add anything here to make the friends button.Look under subs Menu_MouseDown and Menu_MouseUp. Link to comment Share on other sites More sharing options...
escfoe2 Posted May 11, 2013 Share Posted May 11, 2013 Well it doesn't go under GUI_FRIENDS.That I know for sure. Link to comment Share on other sites More sharing options...
vulcano Posted May 11, 2013 Author Share Posted May 11, 2013 !EDITI dont know whyBut, the Guild button open the quest menu now… Why?The button dont work... ![:(](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/sad.png)Ok I put in Menu_MouseUp```' friend buttonI = 56x = GUIWindow(GUI_MENU).x + Buttons(I).xy = GUIWindow(GUI_MENU).y + Buttons(I).y' check if we're on the buttonIf (GlobalX >= x And GlobalX <= x + Buttons(I).Width) And (GlobalY >= y And GlobalY <= y + Buttons(I).Height) Then If Buttons(I).state = 2 Then ' do stuffsOpenGuiWindow 8 ' play sound PlaySound Sound_Buttonclick, -1, -1 End IfEnd If```And in Menu_MouseDown``` ' friends buttonI = 56If Buttons(I).Visible Then x = GUIWindow(GUI_MENU).x + Buttons(I).x y = GUIWindow(GUI_MENU).y + Buttons(I).y ' check if we're on the button If (GlobalX >= x And GlobalX <= x + Buttons(I).Width) And (GlobalY >= y And GlobalY <= y + Buttons(I).Height) Then Buttons(I).state = 2 ' clicked End IfEnd If``` Link to comment Share on other sites More sharing options...
Zeno Posted May 12, 2013 Share Posted May 12, 2013 You click it and the quest log opens? Great! You should feel pretty good about getting all that done.I think you're done once you fix one tiny little number. In Mouse_MenuDown you've got:```If Buttons(I).state = 2 Then'do stuffsOpenGuiWindow 8```GuiWindow 8 is the quest log. You want OpenGuiWindow 10\. Check out Sub OpenGuiWindow for further clarification on the arrays for OpenGuiwindow. Link to comment Share on other sites More sharing options...
vulcano Posted May 12, 2013 Author Share Posted May 12, 2013 OMG OMG OMG OMGThanks Zeno and escfoe2This works!Thank you so much!Resolved! 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