sir zach Posted May 24, 2009 Author Share Posted May 24, 2009 Don't have a tutorial yet. Idk if I'm gonna make one… Just explore the files and see how it works :)http://www.freemmorpgmaker.com/files/imagehost/pics/a1ea2e804623f6b344c7caf1e2fb3fc8.rar Link to comment Share on other sites More sharing options...
dao Posted May 24, 2009 Share Posted May 24, 2009 nice find.. awesome Link to comment Share on other sites More sharing options...
sir zach Posted May 24, 2009 Author Share Posted May 24, 2009 I made it lol Link to comment Share on other sites More sharing options...
dao Posted May 24, 2009 Share Posted May 24, 2009 oh nicer lol Link to comment Share on other sites More sharing options...
goku1993 Posted May 26, 2009 Share Posted May 26, 2009 looks pretty good,like it lol mind if i use it for my game (checked the code so i think i could do it) Link to comment Share on other sites More sharing options...
sir zach Posted May 26, 2009 Author Share Posted May 26, 2009 Yeah, go ahead :) No credits necessary :) Link to comment Share on other sites More sharing options...
Robin Posted May 31, 2009 Share Posted May 31, 2009 This is a horribly dated technique. Adding in extra form components is never the best solution.If you did actually write this, and from looking through the code I doubt this, then you should have no problem writing up a class file which would allow this all to be handled through either BitBlt or DirectDraw.Here's a much better way of doing things, in DirectDraw7:```Private button() as new clsButtonPrivate buttonCount as bytePrivate sub initButtons() redim button(0 to buttonCount) ' Format for storing button information, use in class. button(0).x = [value] button(0).y = [value] button(0).width = [value] button(0).height = [value] button(0).state = BUTTON_STATE_NORMAL 'etc. etc. Either use this to hardcode all button placements, or 'you could load from a .ini or .xml file.end sub```Then, when you have either a DirectInput mousemove event or a mouse is moved over your form, call a loop which checks each button and sets their state accordingly.```Public Sub CheckButtons(ByVal x As Single, ByVal y As Single, ByVal button As Integer)Dim i As Long For i = 0 To MaxButtons With button(i) If x > .x And x < .x + .Width Then If y > .y And y < .y + .Height Then If button = BUTTON_LEFTMOUSE Then ' no idea on the const in vb6. .state = BUTTON_STATE_CLICKED Exit Sub End If .state = BUTTON_STATE_HOVER Exit Sub End If End If End With NextEnd Sub```Then, in your main rendering loop, simply set it to use the class' .x, .y, .height and .width for the destrect. You could even store a srcrect in the class, rather than creating it each loop.Not only is this much more modular than your program, it allows for on-screen buttons.Yours,_Robin_ 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