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
3 registered members (NewbieZorro, TipmyPip, 1 invisible), 19,045 guests, and 8 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 3 of 4 1 2 3 4
Re: button problem!!! [Re: lostclimate] #88322
09/01/06 06:35
09/01/06 06:35
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
yeah i know... alright so if thats just defining the button how do i fix it

michael your bit of code didnt work as thats using a function... no functions


Visit us at www.m-tec-development.com WIP - Urban Conflict
Re: button problem!!! [Re: lostclimate] #88323
09/01/06 07:41
09/01/06 07:41
Joined: Apr 2005
Posts: 2,332
Germany, BaWü
aztec Offline

Expert
aztec  Offline

Expert

Joined: Apr 2005
Posts: 2,332
Germany, BaWü
didnt we all say you need to add functions to your buttons?


Visit:
schwenkschuster-design.de
Re: button problem!!! [Re: Silent_Assassin] #88324
09/01/06 09:04
09/01/06 09:04
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Quote:


4. I want the sit bmap to change into the sit button bmap.. both have been defined.





Change by what? If the mouse is over the button or when its clicked on?
If its just all about changing the bmap of the button while the mouse is over it here is your solution:
Code:

bmap sitbutton = "sitbutton.bmp";
bmap sit = "sit.bmp";

panel panel1
{
pos_x = 70;
pos_y = 600;
layer = 1;
button = 0, 0, sit, sit, sitbutton, null, null, null;
flags = visible, transparent;
}



Re: button problem!!! [Re: Xarthor] #88325
09/03/06 03:37
09/03/06 03: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
i need it to change when its clicked on


Visit us at www.m-tec-development.com WIP - Urban Conflict
Re: button problem!!! [Re: Silent_Assassin] #88326
09/03/06 09:10
09/03/06 09:10
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
That cannot be done without function.

Code:

bmap sitbutton ="sitbutton.bmp";
bmap sit = "sit.bmp";

panel panel1
{
bmap = sit;
pos_x = 70;
pos_y = 600;
layer = 1;
flags = visible,transparent;
on_click = change_sitbtn;
}

function change_sitbtn(panel)
{
if(panel.bmap == sit)
{
panel.bmap = sitbutton;
}
else
{
panel.bmap = sit;
}
}


NOT TESTED

Re: button problem!!! [Re: Xarthor] #88327
09/03/06 11:19
09/03/06 11:19
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 thunder that code gives me quite a few errors lol


Visit us at www.m-tec-development.com WIP - Urban Conflict
Re: button problem!!! [Re: Silent_Assassin] #88328
09/03/06 13:23
09/03/06 13:23
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Then gimme the errors and I'll try to sort it out.

Question:
What edition and version of 3dgs do you use?

Re: button problem!!! [Re: Xarthor] #88329
09/04/06 04:42
09/04/06 04:42
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
I am using A6 version 6.40.5

The errors i am getting are...

34:0 Error(57):Parameter unknown _arg1 Parameter

35:0 Error(57:Parameter unknown _arg1 Parameter

36:0 Error(96):Syntax error -nonexistent/empty function change_sitbtn

38:0 Error(19):Parameter unknown else bad keyword in {}

39:0 Error(19): Parameter unknown panel.bmap bad keyword in {}

Last edited by Silent_Assassin; 09/04/06 04:46.

Visit us at www.m-tec-development.com WIP - Urban Conflict
Re: button problem!!! [Re: Silent_Assassin] #88330
09/04/06 09:17
09/04/06 09:17
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Well in the manual they use a similar code as example for "on_click" however I changed it a bit, now its just for panel1:

Code:

bmap sitbutton ="sitbutton.bmp";
bmap sit = "sit.bmp";

function change_sitbtn(); //prototype, guess this is necessary with "on_click"

panel panel1
{
bmap = sit;
pos_x = 70;
pos_y = 600;
layer = 1;
flags = visible,transparent;
on_click = change_sitbtn;
}

function change_sitbtn()
{
if(panel1.bmap == sit)
{
panel1.bmap = sitbutton;
}
else
{
panel1.bmap = sit;
}
}



EDIT:
just took a look into the manual again, this should work too, according to the manual:
Code:

bmap sitbutton ="sitbutton.bmp";
bmap sit = "sit.bmp";

function change_sitbtn(panel); //prototype

panel panel1
{
bmap = sit;
pos_x = 70;
pos_y = 600;
layer = 1;
flags = visible,transparent;
on_click = change_sitbtn;
}

function change_sitbtn(panel)
{
if(panel.bmap == sit)
{
panel.bmap = sitbutton;
}
else
{
panel.bmap = sit;
}
}



Last edited by Thunder; 09/04/06 09:19.
Re: button problem!!! [Re: Xarthor] #88331
09/04/06 10:21
09/04/06 10:21
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
nope same errors XD


Visit us at www.m-tec-development.com WIP - Urban Conflict
Page 3 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