| Mirage Source http://web.miragesource.net/forums/ |
|
| Show Names on Hover http://web.miragesource.net/forums/viewtopic.php?f=210&t=50 |
Page 1 of 1 |
| Author: | Tutorial Bot [ Thu Jun 01, 2006 9:19 pm ] |
| Post subject: | Show Names on Hover |
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) This change sets the CurX and CurY values (which will be added in a little bit) to the tile you are hovering over.Call EditorMouseDown(Button, Shift, x, y) CurX = Int(x / PIC_X) CurY = Int(y / PIC_Y) End Sub In modGameLogic, under: Code: ' Game fps Public GameFPS As Long Add: Code: 'Loc of pointer This sets the CurX and CurY variables.Public CurX As Integer Public CurY As Integer 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! |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|