Print Page | Close Window

Blt Name on Hover

Printed From: Mirage Source
Category: Tutorials
Forum Name: Submitted Tutorials
Forum Discription: Tutorial submissions for MSE are posted here, waiting for approval
URL: http://ms.shannaracorp.com/backup-forums/forum_posts.asp?TID=113
Printed Date: 20 December 2006 at 6:03pm
Software Version: Web Wiz Forums 8.01 - http://www.webwizforums.com


Topic: Blt Name on Hover
Posted By: Sync
Subject: Blt Name on Hover
Date Posted: 11 February 2006 at 2:09pm
Originally posted by Dark Dragon

Name: No Names unless Hovered Over
By: Dark//Dragon
Difficulty: 1/5

What it Will Do:
By Adding this tutorial, peoples names will not be Blitted unless you hover you're mouse over them.

All Client Side

++++++++++
frmMirage
++++++++++

Change the private sub picScreen Mouse move to:
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 (we will add these variables later =) ) to the tile you are hovering over.

++++++++++
modGameLogic.bas
++++++++++

at the top under
' Game fps
Public GameFPS As Long


add

'Loc of pointer
Public CurX As Integer
Public CurY As Integer


this ads the Cur X and Y variables.

now in sub gameloop, change

        ' 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


        ' 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


now you should be all set... !

ya i know its simple, but it might help somebody new..  :wink:



Print Page | Close Window

Bulletin Board Software by Web Wiz Forums version 8.01 - http://www.webwizforums.com
Copyright ©2001-2006 Web Wiz Guide - http://www.webwizguide.info