Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,449 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 4 of 4 1 2 3 4
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 Offline
Expert
Xarthor  Offline
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: Xarthor] #88333
09/05/06 07:12
09/05/06 07:12
Joined: Jun 2005
Posts: 734
Under your couch
Silent_Assassin Offline OP
Developer
Silent_Assassin  Offline OP
Developer

Joined: Jun 2005
Posts: 734
Under your couch
alrighty i fixed it so no errors come up (same code as you have there) but still panel doesnt change :S


Visit us at www.m-tec-development.com WIP - Urban Conflict
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 Offline
Expert
Xarthor  Offline
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: Xarthor] #88335
09/08/06 04:51
09/08/06 04:51
Joined: Jun 2005
Posts: 734
Under your couch
Silent_Assassin Offline OP
Developer
Silent_Assassin  Offline OP
Developer

Joined: Jun 2005
Posts: 734
Under your couch
lol i dont think so umm heres the code again

Quote:


var video_mode = 8; // 800x600
var video_depth = 16; // 16 bit mode

string contestentry_wmb = <contestentry.wmb>;
bmap sleepbutton = "sleepbutton.bmp";
bmap jump = "jump.bmp";
bmap breathfire = "breathfire.bmp";
bmap breathfirebutton = "breathfirebutton.bmp";
////////////////////////////////////////////////////////////

bmap sitbutton = "sitbutton.bmp";
bmap sit = "sit.bmp";
function change_sitbtn();
panel panel1
{
pos_x = 70;
pos_y = 600;
bmap = "sit";
flags = visible, transparent;
on_click = change_sitbtn;
}
function change_sitbtn()
{
if(panel1.bmap == sit)
{
panel1.bmap = sitbutton;
}
else
{
panel1.bmap = sit;
}
}
function main()
{
level_load (contestentry_wmb);
clip_size = 0; // show all the triangles for all the models
fps_max = 40; // lock the frame rate to 40 fps
}



bmap bmap_background2 = <sleep.bmp>;
panel panel2{
pos_x = 310;
pos_y = 600;
layer = 1;
bmap = bmap_background2;
flags = visible, transparent;
}

bmap bmap_background3 = <jump.bmp>;
panel panel3{
pos_x = 550;
pos_y = 600;
layer = 1;
bmap = bmap_background3;
flags = visible, transparent;
}

bmap bmap_background4 = <breathfire.bmp>;
panel panel4{
pos_x = 800;
pos_y = 600;
layer = 1;
bmap = bmap_background4;
flags = visible, transparent;
}

bmap bmap_background5 = <exit.bmp>;
panel panel5{
pos_x = 800;
pos_y = 20;
layer = 1;
bmap = bmap_background5;
flags = visible, transparent;
}






if i need the mouse mode and mouse map where do i place the code ?


Visit us at www.m-tec-development.com WIP - Urban Conflict
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 Offline
Expert
Xarthor  Offline
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 Offline OP
Developer
Silent_Assassin  Offline 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


Visit us at www.m-tec-development.com WIP - Urban Conflict
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 Offline
Expert
Xarthor  Offline
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.
Re: button problem!!! [Re: Xarthor] #88339
09/08/06 12:45
09/08/06 12:45
Joined: Jun 2005
Posts: 734
Under your couch
Silent_Assassin Offline OP
Developer
Silent_Assassin  Offline OP
Developer

Joined: Jun 2005
Posts: 734
Under your couch
yep thats cool

thanks for that thunder... hope it wasnt too much of a hassle


Visit us at www.m-tec-development.com WIP - Urban Conflict
Page 4 of 4 1 2 3 4

Gamestudio download | 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