Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Show Names on Hover
#1
Author: Dark Dragon
Difficulty: 1/5

By adding this tutorial, player names will not be displayed unless you hover your mouse over them.

In frmMirage, change Private Sub picScreen_MouseMove to:
Code:
Private Sub picScreen_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
    Call EditorMouseDown(Button, Shift, x, y)
    
        CurX = Int(x / PIC_X)
        CurY = Int(y / PIC_Y)

End Sub
This change sets the CurX and CurY values (which will be added in a little bit) to the tile you are hovering over.

In modGameLogic, under:
Code:
' Game fps
Public GameFPS As Long
Add:
Code:
'Loc of pointer
Public CurX As Integer
Public CurY As Integer
This sets the CurX and CurY variables.

Now, in Sub Gameloop, change:
Code:
' Lock the backbuffer so we can draw text and names
        TexthDC = DD_BackBuffer.GetDC
        For I = 1 To MAX_PLAYERS
              If IsPlaying(I) And GetPlayerMap(I) = GetPlayerMap(MyIndex) Then
                  Call BltPlayerName(I)
              End If
        Next I
To:
Code:
' Lock the backbuffer so we can draw text and names
        TexthDC = DD_BackBuffer.GetDC
        For I = 1 To MAX_PLAYERS
              If IsPlaying(I) And GetPlayerMap(I) = GetPlayerMap(MyIndex) Then
                  If Player(I).x = CurX And Player(I).y = CurY Then
                      Call BltPlayerName(I)
                  End If
              End If
        Next I
All done!
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)