simple button

Posted By: marvz

simple button - 07/02/11 06:50

///////////////////////////////
#include <acknex.h>
#include <default.c>

///////////////////////////////


PANEL* main_menu=
{
bmap = "background1.pcx"; //bankground image
pos_x = 0;
pos_y = 0;
button (300, 150, "file.pcx", "file.pcx", "file.pcx",a, NULL, NULL,);
button (300, 250, "intro.pcx", "intro.pcx", "intro.pcx", NULL,NULL,NULL,);
button (300, 350, "credits.pcx", "credits.pcx", "credits.pcx", NULL,NULL,NULL,);
flags = VISIBLE | OVERLAY;
}

PANEL * load_play =
{
bmap = "background1.pcx";
pos_x = 0;
pos_y = 0;
button (300, 150, "file.pcx", "file.pcx", "file.pcx",NULL, NULL, NULL,);
flags = VISIBLE | OVERLAY;
}

function a()
{
load_play.visible=on;
}

function quit_program()
{
while (key_any) {wait (1);}
sys_exit(NULL);
}

SOUND* explo_snd = "gamesnd.wav";

function click()
{
snd_play(explo_snd,100,2);
}


what's wrong with this code that i've made.. everytime i run, it contains errors which is the .visible is not part of panel? can you help me to fix this bugs..
Posted By: Ascalon

Re: simple button - 07/02/11 07:33

use set(load_play,VISIBLE) or reset(load_play,VISBLIE) in lite-c instead of load_play.visible=on
Posted By: marvz

Re: simple button - 07/02/11 07:41

there is no error with this code the problem instead, only function a() appears on the window it should be the main_menu, and if i clicked the file.pcx, then the function a() will appear. plz help..
Posted By: Ascalon

Re: simple button - 07/02/11 07:52

where is your function main() ? you need it to start the level or an empty level
Posted By: marvz

Re: simple button - 07/02/11 08:11

i dont have any level yet. i only try to make a simple button.
Posted By: the_clown

Re: simple button - 07/03/11 13:41

You still need a main function. The main function is the function that is called by the engine at startup. You'll have to put everything in there you wanna be happening at startup.
© 2024 lite-C Forums