Re: Tutorial: CSQC GUI Menus
Posted: Sat Feb 18, 2012 1:43 pm
In other words: this.Jukki wrote:IF you code csqc in your engine then yes.
In other words: this.Jukki wrote:IF you code csqc in your engine then yes.
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);
};
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);
};
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);