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

Show/Hide GUI


boyesjs03
 Share

Recommended Posts

Basically this tutorial will show you how to create a simple label inside a picturebox that hides and shows your differ GUI aspects.

First you will need to follow this tutorial.

www.touchofdeathforums.com/community/index.php?/topic/118055-game-picscreen-resolution/

Dont forget to:

set top and left of the picScreen to 0

Resize your form

Delete all maps from server and client data files

After you have successfully made your picScreen full screen/ with no GUI you will now have to make a picturebox to hold your buttons, call this box "ButtonBox".

Cut the buttons with ctrl + X then click the picture box and paste them to put them inside the control.

Next create another picturebox and a label inside it.

Label properties:

Name: lblHideGui

Caption: Hide GUI

Background: Transparent

Autosize: True

Picturebox:

Name: picHideGui

Autosize: True

Then double click the LABEL, not the picturebox and make the code look like this:

```

Private Sub lblHideGui_Click()

If ButtonBox.Visible = False Then

picInventory.Visible = True

picParty.Visible = True

picOptions.Visible = True

picSpells.Visible = True

picCharacter.Visible = True

ButtonBox.Visible = True

lblHideGui.Caption = "Hide GUI"

txtChat.Visible = True

txtMyChat.Visible = True

Else

ButtonBox.Visible = False

picInventory.Visible = False

picParty.Visible = False

picOptions.Visible = False

picSpells.Visible = False

picCharacter.Visible = False

txtChat.Visible = False

txtMyChat.Visible = False

lblHideGui.Caption = "Show GUI"

End If

End Sub
```
Link to comment
Share on other sites

Nice short and basic Tutorial :-)

All newbs here please… here can you learn already how to make stuff visible and invisible ;-)

Sitting War idk why but i just see you everywhere posting comments *.* xD

Theres not much time anymore and i need to do an Basics tutorial where every litte crap is explained... uff haha

IF you got skype write me you Skypename (PM)
Link to comment
Share on other sites

  • 3 months later...
I don't know if I've misunderstood, but I'm confused, either way.

The code makes the button disappear, but at the same time you want it to change the caption to 'Show GUI'. I tested and this simply removes gui (along with the button) and then you have to re-client to get it back.

I remade this using a much more cluttered method (that works for me), which is also customized to hide certain GUI, but more can be added easily.

```

Private Sub imgHideBar_Click()

If Not picHotbar.Visible Then

' show hotkey bar

picHotbar.Visible = True

Else

picHotbar.Visible = False

End If

If Not coinbox.Visible Then

' show coinbox

coinbox.Visible = True

Else

coinbox.Visible = False

End If

End Sub

```

*code is simply to show an example, it won't work unless you modify it to co-operate with your buttons and your GUI parts.
Link to comment
Share on other sites

Don't do it that way, booleans are magical!

Use their magic! D:

```
Private Sub imgHideBar_Click()
    picInventory.Visible = Not picInventory.Visible
    ButtonBox.Visible = Not ButtonBox.Visible
    picInventory.Visible = Not picInventory.Visible
    picParty.Visible = Not picParty.Visible
    picOptions.Visible = Not picOptions.Visible
    picSpells.Visible = Not picSpells.Visible
    picCharacter.Visible = Not picCharacter.Visible
    txtChat.Visible = Not txtChat.Visible
    txtMyChat.Visible = Not txtMyChat.Visible
End Sub
```
Link to comment
Share on other sites

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