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

[EO , EO 2.0, EO 3.0 = Easy Movable GUI]


hisherwin
 Share

Recommended Posts

Well i found that other movable GUI are buggy …

So i made something that is not . Eh little bit Buggy
Actually i ripped this on a Visual Basic Project (Not Eclipse)

Lets Start

Client Side Only

Lets make a MouseDown for the picture you want to Move..

```
Private Sub picture_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
    picture.ZOrder (0)
End Sub
```
Now this will enable you to move the picture , But it need a MouseMove attach on it..

Lets make a MouseMove for the picture..

```
Private Sub picture_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
    Static MouseX As Long, MouseY As Long
    Dim TempX As Long, TempY As Long

    If Button = 1 Then
        If y < 22 Then
            TempX = picture.Left + (x - MouseX)
            TempY = picture.top + (y - MouseY)

            If TempX < 0 Then TempX = 0
                If TempX > (500 - picture.width) Then TempX = (500 - picture.width)
            If TempY < 0 Then TempY = 0
                If TempY > (500 - picture.height) Then TempY = (500 - picture.height)

            picture.Left = TempX
            picture.top = TempY
        End If
    Else
        MouseX = x
        MouseY = y
    End If
End Sub

```
Change the picture height and width if you want .. Change the "picture" also..

I hope this will help..
Link to comment
Share on other sites

This isn't really a very good way of moving a physical object within visual basic. Why not just use the .move functionality? Example -

```
PictureExample.Move PictureExample.Left - (StartX- X), PictureExample.Top - (StartY- Y)
```
All you need to do with this method is add an onmousedown event and manage the StartX/Y cords from there.
Link to comment
Share on other sites

@zerohero:

> This isn't really a very good way of moving a physical object within visual basic. Why not just use the .move functionality? Example -
>
> ```
> PictureExample.Move PictureExample.Left - (StartX- X), PictureExample.Top - (StartY- Y)
> ```
> All you need to do with this method is add an onmousedown event and manage the StartX/Y cords from there.

This will or freeze gamescreen or it will drop that shadow thing
Link to comment
Share on other sites

  • 2 weeks later...
Sorry it's a bit hard for me to use visual basic ^^
i need more clear details ( i know you do as you can )
Ok so if i understand i need to put Mouse move + Mouse Down code
then after that i need to add another code (as you said in your last message) but where is it ?
i see only 2 codes one for mousemove and another for mousedown :S

i'm using nightly Eclipse dx8 (if it can help you )
Link to comment
Share on other sites

This tut work for Eo and Eo 3.0 … If you are using this tut for picCharacter, picInventory then just find their mousemove and mousedown , If they don't have then just create one..

```
Private Sub picCharacter_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)

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