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

Dx8 Buttons :)


Ariel
 Share

Recommended Posts

Im using CS:DE and i cant figure out how the buttons works?

i saw that its making a "field" that if my mouse is in its know its a button but how do i edit it ?

how i move buttons :\

This sub for example:
```
' Menu
Public Sub Menu_MouseUp()
Dim i As Long, x As Long, y As Long, Buffer As clsBuffer

    ' find out which button we're clicking
    For i = 1 To 6
        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
            If Buttons(i).state = 2 Then
                ' do stuffs
                Select Case i
                    Case 1
                        ' open window
                        OpenGuiWindow 1
                    Case 2
                        ' open window
                        OpenGuiWindow 2
                    Case 3
                        ' open window
                        OpenGuiWindow 3
                    Case 4
                        ' open window
                        OpenGuiWindow 4
                    Case 5
                        If myTargetType = TARGET_TYPE_PLAYER And myTarget <> MyIndex Then
                            SendTradeRequest
                        Else
                            AddText "Invalid trade target.", BrightRed
                        End If
                    Case 6
                        ' open window
                        OpenGuiWindow 6
                End Select
                ' play sound
                Play_Sound Sound_ButtonClick
            End If
        End If
    Next

    ' reset buttons
    resetClickedButtons
End Sub
```
Link to comment
Share on other sites

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