Hi,
I would know if it's possible to add a color to player name. Cause unity text component have a color option. So if someone can tell me if it's possible to get this text and add color to it, it's will be cool !
Thanks
Color overhead name?
Discussion in 'Hurtworld Development' started by [LTS] Hypo, Feb 4, 2016.
-
If you just want it in chat, look at BetterChat.
-
I want to display this color on the name over the character. He is actually white by default.
-
-
Thanks for your quick reply
-
You'll want to look at GameManager.ChangeNameServer(), and inject color tags there.
-
-
Wulf Community Admin
-
public void ChangeNameServer(string playerName, NetworkMessageInfo info) -
Wulf Community Admin
Code:GameManager.Instance.ChangeNameServer("<color=red>Your Name</color>", info);
-
-
Wulf Community Admin
-
-
use RPC "UpdateName" after using session.WorldPlayerEntity.GetComponent<HurtMonoBehavior>();
-
-
Once you have their PlayerSession you can use:
Code:session.WorldPlayerEntity.GetComponent<HurtMonoBehavior>().RPC("UpdateName", uLink.RPCMode.OthersExceptOwnerBuffered, "<color=red>"+session.Name+"</color>");
-
I'm going to change the arg type of ChangeNameServer to NetworkPlayer instead of NetworkMessageInfo, which should make this much easier.
-
Adding on to this is there any way to get Infamous/Outlaw symbol above player head if a player is infamous/outlaw?
Thanks, -
-
In which case it might be possible to find the hex values of the different states of infamy (if it has defaultincremented steps) and do something like
str = str.replace('<color=#FF0000>,☠<br>''); ? using different unicode pictographs for the various states of infamy.