Mirage Source
[General] Stop Player Names from going offscreen - Printable Version

+- Mirage Source (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: Source Code Development (https://mirage-engine.uk/forums/forumdisplay.php?fid=51)
+----- Forum: Mirage Source 4 (Visual Basic 6) (https://mirage-engine.uk/forums/forumdisplay.php?fid=44)
+------ Forum: Tutorials (https://mirage-engine.uk/forums/forumdisplay.php?fid=13)
+------ Thread: [General] Stop Player Names from going offscreen (/showthread.php?tid=2126)



[General] Stop Player Names from going offscreen - Jacob - 19-09-2008

This will prevent Player Names from going off screen.

modText

Sub DrawPlayerName

Find
Code:
' Determine location for text
    TextX = GetPlayerX(Index) * PIC_X + Player(Index).XOffset + (PIC_X \ 2) - ((Len(GetPlayerName(Index)) / 2) * 8)
    TextY = GetPlayerY(Index) * PIC_Y + Player(Index).YOffset - (PIC_Y \ 2) - 4

Right After Add
[code]If TextY


Re: [General] Stop Player Names from going offscreen - Mattyw - 19-09-2008

Works epicly. Thanks. =-p


Re: [General] Stop Player Names from going offscreen - Robin - 19-09-2008

Coulda just ripped it from Essence xD


Re: [General] Stop Player Names from going offscreen - GIAKEN - 19-09-2008

I did this for Elmysia after I saw it done on Mirage Realms Big Grin


Re: [General] Stop Player Names from going offscreen - Jacob - 19-09-2008

Yeah you could rip it from something, but i'm inflating my epenis with the most tutorials.


Re: [General] Stop Player Names from going offscreen - Mattyw - 19-09-2008

Race system then. =-p

Another tutorial! ;D


Re: [General] Stop Player Names from going offscreen - Jacob - 19-09-2008

I don't take requests.


Re: [General] Stop Player Names from going offscreen - Mattyw - 20-09-2008

Modification to work for NPC's:

CLIENT

Look for "Sub BltNPCName", then scroll down until:

Code:
'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

Then add the following directly after it:

[code]If TextY


Re: [General] Stop Player Names from going offscreen - GIAKEN - 20-09-2008

The best way to do it would to just do it in Sub DrawText.