Measuring the length of Name String
Moderator: InsideQC Admins
1 post
• Page 1 of 1
Measuring the length of Name String
I'm planning on adding Kill Icons instead of the quake traditional "Player killed Player2 with WeaponX" I want it to look like "Player1 [ICON] Player2" I can see already that in order to do this I would need to get the length of the player's name string and then place the icon X amount of pixels after the name string. What would be the best method? I could set the number of space required for the icon between player1's name and player2's in QC. I would only need the length of the string to place it correctly on the HUD. And also CSQC is not an option for this one.
Thanks in advance
EDIT: Ok with a little (more) research i came up with:
Is that correct? And how would I translate that into pixels? would i just take strlen(sting)*pixel width, to get my output? Where in the quake engine is bprint handled or player names?
Thanks in advance
EDIT: Ok with a little (more) research i came up with:
- Code: Select all
#include <cstring>
using std::strlen;
int n = strlen(playername);
Is that correct? And how would I translate that into pixels? would i just take strlen(sting)*pixel width, to get my output? Where in the quake engine is bprint handled or player names?
- Ghost_Fang
- Posts: 336
- Joined: Thu Nov 12, 2009 4:37 am
1 post
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest