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

Closable GUI Windows!


Jeff
 Share

Recommended Posts

Hello, this is my first tutorial.  It's really simple so if you're a newb this is a good one to try out!  This tutorial will show you the basics, but it is also fully functional for all windows corresponding to the GUI buttons except for picTrade.

**You will need:**
Special GUI windows having an X in the top right corner(attached)
A copy of VB6
basic navigation knowledge to install.
This tutorial installed and functioning on all desired windows: http://www.touchofdeathforums.com/smf/index.php/topic,67261.0.html

Now, for each window you want to make closable, first find their respective 'Mouse Down' Sub.  At the bottom of it but above
```
' Error handler

```(only if applicable.  ' Error handler won't be in every sub. if it is not in the sub, just place the code at the bottom of the sub.)

add
```
    If x > picPICNAME.width - 10 Then
        If y < -picPICNAME.height + 281 Then
            picPICNAME.Visible = False
        End If
    End If

```
replace picPICNAME with whatever pic it's designed to replace.
now, let's break down the code.  First it checks if your mouse is in the left most 10 pixels.  Then, it checks if your mouse is in the top corner.  It checks the top corner because 292 is the height of the picbox.  281 is the height minus 11, and 11 is the height of the x.  Finally it simply makes the picbox invisible.

That's it!

If you have any trouble or if there's a bug, post here.  I have bug tested it, but I may have missed something.
Link to comment
Share on other sites

@Erkro1:

> Nice, might be usefull for some games where the GUI is over the picScreen. ;)

well now I'd say any game that wants to can put their GUI over the picScreen.  With my tutorial and Sekaru's, it just takes a few minutes to get the system working nicely.
Link to comment
Share on other sites

@RyokuHasu:

> Nice, i already have my own mod for it though, most people with custom GUIs just make it themselves since every GUI has custom needs.

this is just to show you how to do it.  Also, it's a very efficient method.  It's simple and quick.  Some people might try and make labels for every x, and that could get messy and is a lot slower than this method.
Link to comment
Share on other sites

@RyokuHasu:

> ah, I see. i just made a new image button that universaly hides all the player menus. =D

wait, so you can't close 1 menu without closing them all?  sounds pretty inefficient, but whatever.  Also another way You could easily do this is if you shift click or right click the original button it could close, but I like my method better.
Link to comment
Share on other sites

  • 7 months later...

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...