Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (Ayumi), 662 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
simple button #376360
07/02/11 06:50
07/02/11 06:50
Joined: Apr 2011
Posts: 36
M
marvz Offline OP
Newbie
marvz  Offline OP
Newbie
M

Joined: Apr 2011
Posts: 36
///////////////////////////////
#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..

Re: simple button [Re: marvz] #376361
07/02/11 07:33
07/02/11 07:33
Joined: Apr 2005
Posts: 274
austria
Ascalon Offline
Member
Ascalon  Offline
Member

Joined: Apr 2005
Posts: 274
austria
use set(load_play,VISIBLE) or reset(load_play,VISBLIE) in lite-c instead of load_play.visible=on


my webside : www.ascalon.jimdo.de
Re: simple button [Re: Ascalon] #376364
07/02/11 07:41
07/02/11 07:41
Joined: Apr 2011
Posts: 36
M
marvz Offline OP
Newbie
marvz  Offline OP
Newbie
M

Joined: Apr 2011
Posts: 36
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..

Re: simple button [Re: marvz] #376366
07/02/11 07:52
07/02/11 07:52
Joined: Apr 2005
Posts: 274
austria
Ascalon Offline
Member
Ascalon  Offline
Member

Joined: Apr 2005
Posts: 274
austria
where is your function main() ? you need it to start the level or an empty level


my webside : www.ascalon.jimdo.de
Re: simple button [Re: Ascalon] #376367
07/02/11 08:11
07/02/11 08:11
Joined: Apr 2011
Posts: 36
M
marvz Offline OP
Newbie
marvz  Offline OP
Newbie
M

Joined: Apr 2011
Posts: 36
i dont have any level yet. i only try to make a simple button.

Re: simple button [Re: marvz] #376492
07/03/11 13:41
07/03/11 13:41
Joined: Nov 2008
Posts: 946
T
the_clown Offline
User
the_clown  Offline
User
T

Joined: Nov 2008
Posts: 946
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.


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1