Change Colors in CSQC Menus or HUD

Discuss CSQC related programming.
Post Reply
Posts: 49
Joined: Wed Oct 20, 2010 6:33 pm
Location: Germany

Change Colors in CSQC Menus or HUD

Post 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);
I am sorry for my English...
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: Change Colors in CSQC Menus or HUD

Post by toneddu2000 »

Thanks for sharing this mini-tut, Rikku2000! You seem a very talented guy! I hope to see more of your work!
Meadow Fun!! - my first commercial game, made with FTEQW game engine
Post Reply