3 registered members (NewbieZorro, TipmyPip, 1 invisible),
19,045
guests, and 8
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: button problem!!!
[Re: Silent_Assassin]
#88332
09/04/06 22:20
09/04/06 22:20
|
Joined: Jul 2002
Posts: 4,436 Germany, Luebeck
Xarthor
Expert
|
Expert
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
|
Lol I don't know what the hell you are doing but the following example works for me: Code:
bmap bild01_map = <bild01.tga>; bmap bild02_map = <bild02.tga>;
function change_image();
panel panel1 { pos_x = 10; pos_y = 10; bmap = bild01_map; flags = visible; on_click = change_image; }
function change_image() { if(panel1.bmap == bild01_map) { panel1.bmap = bild02_map; } else { panel1.bmap = bild01_map; } }
Mouse_mode is set to 2 (two).
|
|
|
Re: button problem!!!
[Re: Silent_Assassin]
#88334
09/05/06 09:09
09/05/06 09:09
|
Joined: Jul 2002
Posts: 4,436 Germany, Luebeck
Xarthor
Expert
|
Expert
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
|
Please post the code. Btw: do you have mouse_mode set to something bigger than zero (e.g. 2) ? And you do have a mouse_map and a function which handles the mouse_pos.x/y ? I mean otherwise you couldn't click on it 
|
|
|
Re: button problem!!!
[Re: Silent_Assassin]
#88336
09/08/06 11:48
09/08/06 11:48
|
Joined: Jul 2002
Posts: 4,436 Germany, Luebeck
Xarthor
Expert
|
Expert
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
|
LOL you don't have any mouse code? How are the buttons supposed to work then anyway?  uhm .. ok just insert this code snippet at the beginning of your code: Code:
bmap arrow_map = <arrow.pcx>; //or whatever your arrow file is
then place this where your functions are/will be: Code:
function set_mouse(_mode) { mouse_mode = _mode; mouse_map = arrow_map; while(mouse_mode > 0) { mouse_pos.x = pointer.x; mouse_pos.y = pointer.y; wait(1); } mouse_map = null; }
And add this at the end of your main function (which loads the level): Code:
set_mouse(2);
I guess thats it.
|
|
|
Re: button problem!!!
[Re: Xarthor]
#88337
09/08/06 12:37
09/08/06 12:37
|
Joined: Jun 2005
Posts: 734 Under your couch
Silent_Assassin
OP
Developer
|
OP
Developer
Joined: Jun 2005
Posts: 734
Under your couch
|
YAY that works  just one last thing not too much trouble hopefully when i click it it stays on the sitbutton bmap... how would i make it so that when i click it it goes to sitbutton then back to sit....i hope that wasnt too confusing lol
|
|
|
Re: button problem!!!
[Re: Silent_Assassin]
#88338
09/08/06 12:41
09/08/06 12:41
|
Joined: Jul 2002
Posts: 4,436 Germany, Luebeck
Xarthor
Expert
|
Expert
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
|
just edit the change function a bit: Code:
function change_sitbtn() { panel1.bmap = sitbutton; wait(-1); //wait 1 second panel1.bmap = sit; }
EDIT: another way: use the button element: Code:
panel panel1 { pos_x = ___ pos_y = ___ layer = ___ button = 0,0,sitbutton,sit,sit,null,null,null; flags = visible; }
Last edited by Thunder; 09/08/06 12:44.
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|