Draw a String over a players Head


(uvhannes) #1

Hello,

is there an easy way to draw a string over a players head? I found several functions for shaders but not for a text.

Any1 up with some ideas / help?

Thx


(kamikazee) #2

I would try to look for the regular name popups in the cgame or ui code, but I can’t look it up right now.


(jaybird) #3

Look in cgame for the code related to floating sprites over players’ heads (i.e. medic, objective, etc). You can then use that code to draw strings over players’ heads. Check out the various DrawString functions to do this.


(uvhannes) #4

yeah thx, already solved that Problem


(duzao7667) #5

Im trying to make the same thing im my mod xD
My trouble is to print the string in all players heads, i dont have suficient info to make a function to pick player by player and render the string over the head of same.

How i can pick player by player and render the string over the head? o.O

Thanks.


(jaybird) #6

Again, look in cg_players for the function that handles drawing sprites over players’ heads. These are icons like revive, etc. You simply need to emulate that with the string drawing functions.


(duzao7667) #7

Uh, you’re fast xDD

Thanks for assist.


(duzao7667) #8

CG_PlayerSprites( centity_t *cent ) make the sprite draw…
But needs the cent class to check and draw… how to get the current entity or enum the entitys to put in function? Something like CG_PlayerSprites( CurrentPlayer(); ) xDDDDDDDDDDDD

thx