.qc (dot qc) - the group for quake c coders of all denominations. If you make quake one mods and write code in quake c, join our group! I'll try to answer any quake c questions - please post your inquiry in the forums...

Forum Thread
  Posts  
client quake c and HUD graphics 1 (Groups : qc : Forum : vault() : client quake c and HUD graphics 1) Locked
Thread Options
numbersix
numbersix quake-c coder++
Jan 2 2016 Anchor

>How do you move the hud so its vertical in the pix?

The console overlay write and draw functions and darkplaces builtins take a vector parameter.

float	drawpic(vector position, string pic, vector size, vector rgb, float alpha, float flag) = #322;

void(vector pos, string pic, float alph, float escala) Sbar_DrawPic =
{
	local vector siz;
	siz = drawgetimagesize(pic) * escala;
	pos = sbar_align(pos);
	drawpic(pos, pic, siz, VEC_1, alph, DRAWFLAG_NORMAL);
};

pos_x is horizontal, and pos_y is vertical. I'm not sure pos_z does anything.
Where they start and which direction they go is controlled by the sbar_align function and these:

float SB_BOTTOM = 0;
float SB_MIDDLE = 1;
float SB_TOP    = 2;
float SB_BOTTOM_RIGHT = 3;
float sb_align;

Which is my one code issue on the HUD. The left aligned stuff requires a fixed vid_conwidth of 800.
Been meaning to add a SB_BOTTOM_LEFT parm.

Reply to thread
click to sign in and post

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.