Page 1 of 1

Change Colors in CSQC Menus or HUD

Posted: Wed Mar 18, 2015 11:12 pm
by Rikku2000
Hey guys i try to coloring my custom HUD for my mod so i Play a bit with Color Settings.

Okey now to the tut i will tell you guys ist very simple todo:

at first open the: "main.qc" and add in: "CSQC_Init"

Code: Select all

	registercommand ("hud_color");
	registercommand ("hud_alpha");

	hud_rgb = '1 1 1';
	hud_a = 0.6;
one more in this file go to: "CSQC_ConsoleCommand" and write under

Code: Select all

strCmd = argv (0);
this code:

Code: Select all

	if (argv(0) == "hud_color") { // Change Image Color best for GRAY!!!
		hud_r = argv(1), hud_g = argv(2), hud_b = argv(3);

		hud_rgb = stov (sprintf ("%g %g %g", stof (hud_r), stof (hud_g), stof (hud_b)));
	}

	if (argv(0) == "hud_alpha") { // Change Alpha Chan...
		hud_a = stof (argv(1));
	}
now open the: "gui_defs.qc" and put somewhere:

Code: Select all

float hud_a; // Alpha
string hud_r, hud_g, hud_b;
vector hud_rgb;
thats all we have to do...

here an note how to add the Color and Alpha:

Code: Select all

drawpic (pos, "gfx/csqc/sbar", size, hud_rgb, hud_a, 0);
Sample:
Image

Re: Change Colors in CSQC Menus or HUD

Posted: Sat Mar 21, 2015 10:08 pm
by toneddu2000
Thanks for sharing this mini-tut, Rikku2000! You seem a very talented guy! I hope to see more of your work!