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 (TedMar), 1,420 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
Menu Script #209956
06/06/08 21:57
06/06/08 21:57
Joined: Mar 2008
Posts: 73
America: New Jersey
Masna Offline OP
Junior Member
Masna  Offline OP
Junior Member

Joined: Mar 2008
Posts: 73
America: New Jersey
I'm trying to write a test script for my opening menu. For some reason at the start up it says Start up Failure. The same thing happens when I try to debug it. Could you help me find any mistakes I could have made?

Thanks,
Masna

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

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

BMAP* Help_Button=
{
pos_x = 300;
pos_y = 300;
layer = 1;
bmap = Help_Button;
flags = OVERLAY | VISIBLE;
}

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

BMAP* Play_Button=
{
pos_x = 300;
pos_y = 400;
layer = 2;
bmap = Play_Button;
flags = OVERLAY | VISIBLE;
}

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


function main()
{
video_mode = 7;
screen_color.blue = 150;
}

Re: Menu Script [Re: Masna] #209965
06/06/08 22:49
06/06/08 22:49
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
You can't define BMAPs in that way, you are getting confused with PANELS. BMAPs point to a single image file.

Load BMAPS > BMAP* my_bmap = "image.bmp";

To display the image you need to define a PANEL...

PANEL* my_pan =
{
pos_x=0;
pos_y=0;
layer=1
bmap = my_bmap;
flags = VISIBLE;
}

Re: Menu Script [Re: Masna] #209967
06/06/08 22:53
06/06/08 22:53
Joined: Apr 2006
Posts: 10
Brasil
alves Offline
Newbie
alves  Offline
Newbie

Joined: Apr 2006
Posts: 10
Brasil
I am Brazilian, I will try to help more!

You must declare PANEL and not BMAP
Code:
PANEL* MenuGame = 
{
   ...
}


And within the block panel, you represent the buttons

Code:
PANEL* MenuGame = 
{
   button (250, 250, "button1.bmp", "button2.bmp", "button3.bmp", function1, function2, function3); 
}


Example functional:

Code:
//header
//=================
#include <acknex.h>
#include <default.c>

function HelpFunction();
function PlayFunction();

//Game Menu
//=====================
PANEL* GameMenu=
{
   pos_x = 50;     
   pos_y = 50;    
   button (250, 250, "PlayButton1.bmp", "PlayButton2.bmp", "PlayButton3.bmp", PlayFunction, NULL, NULL); 
   button (250, 300, "HelpButton1.bmp", "HelpButton2.bmp", "HelpButton3.bmp", HelpFunction, NULL, NULL); 
   flags = OVERLAY | VISIBLE;
}

//Function main
//======================
function main()
{
	mouse_mode = 2;
	while (1)
	{
		mouse_pos.x = mouse_cursor.x;
		mouse_pos.y = mouse_cursor.y;
		wait (1);
	}
}

//Help Function
//======================
function HelpFunction()
{
}

//Game start function 
//======================
function PlayFunction()
{
}



Sorry evil English. I hope I have helped.


Last edited by alves; 06/06/08 22:56.

Breve Meu E-BOOK
Desenvolvimento de Jogos Em Lite-C
Iniciante em 3D Game Studio
Meu Portfólio
Re: Menu Script [Re: alves] #209989
06/07/08 03:46
06/07/08 03:46
Joined: Mar 2008
Posts: 73
America: New Jersey
Masna Offline OP
Junior Member
Masna  Offline OP
Junior Member

Joined: Mar 2008
Posts: 73
America: New Jersey
Thank you everyone for all the help! grin I'm not at my good computer right now and can't test the scripts, but I'm confident they'll work now. smile


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