Menu Script

Posted By: Masna

Menu Script - 06/06/08 21:57

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;
}
Posted By: DJBMASTER

Re: Menu Script - 06/06/08 22:49

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;
}
Posted By: alves

Re: Menu Script - 06/06/08 22:53

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.

Posted By: Masna

Re: Menu Script - 06/07/08 03:46

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
© 2024 lite-C Forums