Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

hey,

 

in form1_mousemove,

how would i accomplish something like

"if you moved the mouse DOWN then...etc"

"if you moved the mouse UP then...etc"

"if you moved the mouse LEFT then...etc"

"if you moved the mouse RIGHT then...etc"

 

and upon doing that, how would u be able to tell how MUCH the mouse moved from its original position

My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!)

vbprogramming.8k.com

My Project (Need VB.NET Programmers)

http://workspaces.gotdotnet.com/ResolutionRPG

  • Administrators
Posted

    Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove
        Static lastX, lastY As Integer

        If e.X > lastX Then   'moved to right
            'difference is e.x-lastx
            label1.text = e.X - lastX
        End If
        'etc

        lastX = e.X
        lastY = e.Y

    End Sub

as a starter should ge tyou going.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...