///////////////////////////////
#include <acknex.h>
#include <default.c>
///////////////////////////////
BMAP* backgroundpergament_tga = "backgroundpergament.jpg"; // background image 800x600
BMAP* transparentbutton = "#210x40x32"; //create temporary black image for button
FONT* normal38_font = "Arial#38"; // was using a cooler font here
FONT* medium44_font = "Arial#44"; // but it's uncommon so changed
FONT* large50_font = "Arial#50"; // it to standard boring arial...
////////////////////////////////////////// START ///////////////////////////////////////
PANEL* start_panel = // the first panel. will show at game start up
{
layer = 1;
pos_x = 250; pos_y = 180;
bmap = backgroundpergament_tga;
size_x = 300; size_y = 300; // just resizing so you can see where panel edges are.
button_toggle(50, 20 , transparentbutton, NULL, NULL, NULL, NULL, pulsate_text_stop, pulsate_text);
button_toggle(50, 120, transparentbutton, NULL, NULL, NULL, NULL, pulsate_text_stop, pulsate_text);
button_toggle(50, 220, transparentbutton, NULL, NULL, NULL, NULL, pulsate_text_stop, pulsate_text);
flags = SHOW; //OVERLAY | SHOW; just disabled OVERLAY so you can see where panel edges are.
}
//
//
TEXT* newgame_txt =
{
pos_x = 405; pos_y = 200;
layer = 2; font = normal38_font;
red = 255; green = 255; blue = 190;
string = "New Game";
flags = CENTER_X | CENTER_Y | SHADOW | SHOW;
}
TEXT* loadgame_txt =
{
pos_x = 405; pos_y = 300;
layer = 2; font = normal38_font;
red = 255; green = 255; blue = 190;
string = "Load a Game";
flags = CENTER_X | CENTER_Y | SHADOW | SHOW;
}
TEXT* options_txt =
{
pos_x = 405; pos_y = 400;
layer = 2; font = normal38_font;
red = 255; green = 255; blue = 190;
string = "Configuration";
flags = CENTER_X | CENTER_Y | SHADOW | SHOW;
}
////////////////////////// FUNCTION MAIN /////////////////////////////////
function main()
{
video_mode = 7; // 800x600
mouse_mode = 1;
level_load(""); // just to display blue background so you can see where panel edges are.
wait (1);
while (1)
{
mouse_pos.x = mouse_cursor.x; // need these to move the cursor
mouse_pos.y = mouse_cursor.y;
wait (1);
if(key_cuu) { loadgame_txt.pos_x -= time_step*2; diag_var("pos_x=%.0f;\n", loadgame_txt.pos_x); }
if(key_cud) { loadgame_txt.pos_x += time_step*2; diag_var("pos_x=%.0f;\n", loadgame_txt.pos_x); }
}
}
//////////////////////////////////////////////////////////////////////////
//
function pulsate_text_stop(var,PANEL*);
//
function pulsate_text(var butt_over, PANEL* this_pan)
{
proc_kill((void*)pulsate_text);
pulsate_text_stop(butt_over, this_pan); //reset all text sizes for this panel
//
TEXT* this_text;
switch(butt_over)
{
case 1: this_text = newgame_txt;
case 2: this_text = loadgame_txt;
case 3: this_text = options_txt;
}
//
while(1)
{
this_text.font = medium44_font; wait (-0.2);
this_text.font = large50_font; wait (-0.2);
this_text.font = medium44_font; wait (-0.2);
this_text.font = normal38_font; wait (-0.2);
}
}
//
function pulsate_text_stop(var butt_left, PANEL* this_pan)
{
proc_kill((void*)pulsate_text);
//
TEXT* this_text;
switch(butt_left)
{
case 1: this_text = newgame_txt;
case 2: this_text = loadgame_txt;
case 3: this_text = options_txt;
}
//
if(this_text.font==large50_font) { this_text.font = medium44_font; wait (-0.2); }
if(this_text.font==medium44_font) this_text.font = normal38_font;
}