Start Panel

Posted By: tek

Start Panel - 07/21/06 02:31

I recently made a panel by following a tutorial, in this panel if I click on the "exit" button I exit the game, now what I want is to make a start button that when I click on it I go to the first level mynewgame.wmb.
how would I do that I already created a bmap startgame.pcx but how do I implement that with the mouse if I click on it I go to the first level ?
this is the code.

Quote:


var video_mode = 7; // 800x600 pixels
var video_depth = 32; // 32 bit mode

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

bmap mouse_pcx = <mouse.pcx>; // bitmap used for the mouse pointer
bmap main_pcx = <main.pcx>; // main panel
bmap quitclicked_pcx = <quitclicked.pcx>;
bmap quitnormal_pcx = <quitnormal.pcx>;
bmap quitover_pcx = <quitover.pcx>;

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

string work06_wmb = <work06.wmb>;

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

function main()
{
level_load (work06_wmb);
mouse_map = mouse_pcx;
mouse_mode = 2;
while (1)
{
mouse_pos.x = pointer.x;
mouse_pos.y = pointer.y;
wait (1);
}
}

function quit_program()
{
sleep (3);
exit;
}

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

panel main_pan
{
bmap = main_pcx;
pos_x = 250;
pos_y = 200;
button = 250, 134, quitclicked_pcx, quitnormal_pcx, quitover_pcx, quit_program, null, null;
flags = overlay, refresh, visible;
}



Posted By: ISG

Re: Start Panel - 07/21/06 02:37

var video_mode = 7; // 800x600 pixels
var video_depth = 32; // 32 bit mode

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

bmap mouse_pcx = <mouse.pcx>; // bitmap used for the mouse pointer
bmap main_pcx = <main.pcx>; // main panel
bmap quitclicked_pcx = <quitclicked.pcx>;
bmap quitnormal_pcx = <quitnormal.pcx>;
bmap quitover_pcx = <quitover.pcx>;
bmap startgame_pcx = <startgame.pcx>;
////////////////////////////////////////////////////////////////////

string work06_wmb = <work06.wmb>;
string mynewgame = <mynewgame.WMB>;

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

function main()
{
level_load (work06_wmb);
mouse_map = mouse_pcx;
mouse_mode = 2;
while (1)
{
mouse_pos.x = pointer.x;
mouse_pos.y = pointer.y;
wait (1);
}
}

function quit_program()
{
sleep (3);
exit;
}

function startgame_function()
{
wait(1);
level_load(mynewgame);
}

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

panel main_pan
{
bmap = main_pcx;
pos_x = 250;
pos_y = 200;
button = 250, 134, quitclicked_pcx, quitnormal_pcx, quitover_pcx, quit_program, null, null;
flags = overlay, refresh, visible;
}

panel start_game
{
bmap = startgame_pcx;
pos_x = 100;
pos_y = 100;
flags = overlay, visible;
on_click = startgame_function();
}
Posted By: tek

Re: Start Panel - 07/21/06 03:12

cool it works, im sorry just one more question when I do load the level the mouse pointer is still on and the main pcx do you know how I could turn that off when I start mynewgame ?
Posted By: ISG

Re: Start Panel - 07/21/06 03:59

Change this function to this:

function startgame_function()
{
wait(1);
level_load(mynewgame);
start_game.visible = off;
//mouse_pcx.visible = off; //MAYBE this is what it is?
}
Posted By: tek

Re: Start Panel - 07/21/06 04:34

nah doesnt work it gives me errors

Parameter unknown start_game keyword

Parameter unknown mouse_pcx keyword

I tried messing with it a little but didnt work
Posted By: ISG

Re: Start Panel - 07/21/06 04:36

Place the Panels syntax above the functions...
Posted By: tek

Re: Start Panel - 07/21/06 04:56

I did that and it started to work problem is that the mouse.pcx still didnt work

function startgame_function()
{
wait(1);
load_level(<mynewgame.wmb>);
start_game.visible = off;
main_pan.visible=off;
mouse_pcx.visible = off;
}

I added the main_pan.visible=off;

I would like to take away the mouse pointers cause moving the mouse I use for my main player for instance it makes him move left and right.
can it be done if not it's ok
Posted By: ISG

Re: Start Panel - 07/21/06 05:10

Make the pointer mouse.pcx defined in a panel then make it appear as a panel, and you can take it away the same way I made main_pan.visible = off; disappear. Try a few things out
Posted By: tek

Re: Start Panel - 07/21/06 05:33

ok thanks ill try it
Posted By: tek

Re: Start Panel - 07/21/06 23:13

:\ I havemt been able to do it, i just cant get rid of the mouse pointers, does anyone know how I can make that dissapear ???
Posted By: tek

Re: Start Panel - 07/25/06 03:37

ok I got it working fine.
thanks for the help
Posted By: ISG

Re: Start Panel - 07/25/06 06:34

Good to hear!! Glad I could of at least been of some help to you!
Posted By: tek

Re: Start Panel - 07/25/06 16:35

yea you helped alot, I just motly worked with the code you gave me and the panel worked.
I found out how to make the mouse pointer disappear for anyone interested in making a panel.

I just put this

function startgame_function()
{
wait(1);
load_level(<mynewgame.wmb>);
start_game.visible = off;
main_pan.visible=off;
mouse_map=off;
mouse_mode=off;
}

both mouse_map and mouse_mode on off I did not put visible but just off and it worked.
Posted By: Scyre

Re: Start Panel - 08/17/06 23:32

doesn't the mouse_mode variable control that?
like:

mouse_mode = 1;

or something?

(I dunno, just thinking)
Hope this helps!

Best Regards, and be good!
Scyre
Posted By: Scyre

Re: Start Panel - 08/17/06 23:36

nevermind!

lmao, I only read the first page in this thread and didn't see problem was already solved!


© 2023 lite-C Forums