Page 4 of 4

Re: Tutorial: CSQC GUI Menus

Posted: Sat Feb 18, 2012 1:43 pm
by frag.machine
Jukki wrote:IF you code csqc in your engine then yes.
In other words: this.

Re: Tutorial: CSQC GUI Menus

Posted: Wed Mar 06, 2013 12:54 pm
by Nahuel
i have a problem darkplaces give me this error "command "testmenu" can not be executed" aniway "testmenu" is executed for darkplaces. How can i fix this glitch?

Re: Tutorial: CSQC GUI Menus

Posted: Sun May 12, 2013 7:05 pm
by Max_Salivan
may be just register another command:)
registercommand("mytestmenu");

Re: Tutorial: CSQC GUI Menus

Posted: Sat Mar 07, 2015 10:51 pm
by Rikku2000
Okey i work a bit with the Menu and write some new code done.

Here an example what i do:
Image

So i do an boxframe that use 9 Images for any side 1 Image:
# # #
# # #
# # #

Code:

Code: Select all

void (float x, float y, float w, float h, vector size, vector rgb, float alpha) drawframe = {
	local vector e_position;
	local float i;

	e_position_x = x;
	e_position_y = y;

	drawpic (e_position, "gfx/csqc/frame/left_top.tga", size, rgb, alpha);

	e_position_y += size_y;

	for (i = 0; i < h; i++) {
		drawpic (e_position, "gfx/csqc/frame/left_center.tga", size, rgb, alpha);

		e_position_y += size_y;
	}

	drawpic (e_position, "gfx/csqc/frame/left_bottom.tga", size, rgb, alpha);

	e_position_x += size_x;

	while (w > 0) {
		e_position_y = y;

		drawpic (e_position, "gfx/csqc/frame/middle_top.tga", size, rgb, alpha);

		e_position_y += size_y;

		for (i = 0; i < h; i++) {
			drawpic (e_position, "gfx/csqc/frame/middle_center.tga", size, rgb, alpha);

			e_position_y += size_y;
		}

		drawpic (e_position, "gfx/csqc/frame/middle_bottom.tga", size, rgb, alpha);

		w -= 1, e_position_x += size_x;
	}

	e_position_y = y;

	drawpic (e_position, "gfx/csqc/frame/right_top.tga", size, rgb, alpha);

	e_position_y += size_y;

	for (i = 0; i < h; i++) {
		drawpic (e_position, "gfx/csqc/frame/right_center.tga", size, rgb, alpha);

		e_position_y += size_y;
	}

	drawpic (e_position, "gfx/csqc/frame/right_bottom.tga", size, rgb, alpha);
};
This will use the handle for the boxframe.

aso a new update is the "spawnbox" i Change the Image Change by an exist Image string:

Code: Select all

void (vector boxpos, string boximg, vector boxsize, string boxtext, vector boxrgb, float boxalpha) spawnbox = {
	drawpic (boxpos, boximg, boxsize, boxrgb, boxalpha);
	drawstring (boxpos + '10 12 0', boxtext, '8 8 0', boxrgb, 1, 1);
};
That allow to use custom Images like logo selection or so.

here an Example: write this to "CSQC_GUI_MenuBackground":

Code: Select all

			menback_pos_x = screen_size_x / 2 - 25 * 8;
			menback_pos_y = screen_size_y / 2 - 20 * 8;

			drawframe (menback_pos_x, menback_pos_y, 23, 18, '16 16 0', '0.6 0.6 1', 0.7);
dont Forget to precache the Image Frames.

Here the Frames i use: DOWNLOAD

Re: Tutorial: CSQC GUI Menus

Posted: Sat Nov 12, 2016 9:43 am
by Julius
Does anyone still have the files for this as the links stopped working?

I found the 1.0 version on my HD from back in the day (PM me if you need it), but the newer ones would be nice to have also.

Best would be if this forum could have small files attachments enabled, so that there isn't a dependence on external links.

I also can't get version 1.0 to work on recent FTEQW builds. FTEQCC compiles it fine (safe a few warnings), but then it crashes the engine when I try to start a map (the regular main menu still works).