| Mirage Source http://www.miragesource.net/forums/ |
|
| Names Above NPCs http://www.miragesource.net/forums/viewtopic.php?f=210&t=55 |
Page 1 of 1 |
| Author: | Tutorial Bot [ Thu Jun 01, 2006 9:33 pm ] |
| Post subject: | Names Above NPCs |
Author: Aydan Difficulty: 2/5 See Also: http://www.key2heaven.net/ms/forums/viewtopic.php?t=82 This is a tutorial on how to add names above an NPC. :: CLIENT SIDE :: In modGameLogic, at the bottom add: Code: Sub BltMapNPCName(ByVal Index As Long) Dim TextX As Long Dim TextY As Long With Npc(MapNpc(Index).Num) 'Draw name TextX = MapNpc(Index).x * PIC_X + MapNpc(Index).XOffset + CLng(PIC_X / 2) - ((Len(Trim$(.Name)) / 2) * 8) TextY = MapNpc(Index).y * PIC_Y + MapNpc(Index).YOffset - CLng(PIC_Y / 2) - 4 DrawText TexthDC, TextX, TextY, Trim$(.Name), vbWhite End With End Sub Then in the same module find this code: 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, MapXOffset, MapYOffset) End If Next i Beneath it add: Code: 'Draw NPC Names For i = LBound(MapNpc) To UBound(MapNpc) If MapNpc(i).Num > 0 Then BltMapNPCName i End If Next i That's all! |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|