Forum

Tutorial: CSQC GUI Menus

Discuss CSQC related programming.

Moderator: InsideQC Admins

Re: Tutorial: CSQC GUI Menus

Postby frag.machine » Sat Feb 18, 2012 1:43 pm

Jukki wrote:IF you code csqc in your engine then yes.


In other words: this.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
User avatar
frag.machine
 
Posts: 2042
Joined: Sat Nov 25, 2006 1:49 pm

Re: Tutorial: CSQC GUI Menus

Postby Nahuel » Wed Mar 06, 2013 12:54 pm

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?
hi, I am nahuel, I love quake and qc.
User avatar
Nahuel
 
Posts: 480
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Re: Tutorial: CSQC GUI Menus

Postby Max_Salivan » Sun May 12, 2013 7:05 pm

may be just register another command:)
registercommand("mytestmenu");
Sorry for my english :)
Max_Salivan
 
Posts: 88
Joined: Thu Dec 15, 2011 1:00 pm

Re: Tutorial: CSQC GUI Menus

Postby Rikku2000 » Sat Mar 07, 2015 10:51 pm

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
I am sorry for my English...
User avatar
Rikku2000
 
Posts: 49
Joined: Wed Oct 20, 2010 6:33 pm
Location: Germany

Re: Tutorial: CSQC GUI Menus

Postby Julius » Sat Nov 12, 2016 9:43 am

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).
Julius
 
Posts: 85
Joined: Sun Aug 29, 2010 4:32 pm

Previous

Return to CSQC Programming

Who is online

Users browsing this forum: No registered users and 1 guest