Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 831 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 4 1 2 3 4
button problem!!! #88302
08/31/06 09:42
08/31/06 09: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
Pretty stupid me asking this but i seem to be having a problem with my button and its stumped me

i have all the panels in that i need and everything and i have the line of code for a button on one of my panels (i wanna fix this before adding the others) but it doesnt seem to work.

It doesnt come up with any errors or nothing the bitmap doesnt change into the one i told it to lol.

Any ideas ?? heres my code.

Quote:



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

string contestentry_wmb = <contestentry.wmb>;
bmap sitbutton = "sitbutton.bmp";
bmap sit = "sit.bmp";
bmap sleepbutton = "sleepbutton.bmp";
////////////////////////////////////////////////////////////

function main()
{
level_load (contestentry_wmb);
clip_size = 0; // show all the triangles for all the models
on_d = null; // disable the "D" key
fps_max = 40; // lock the frame rate to 40 fps
}

bmap bmap_background = <sit.bmp>;
panel panel1{
bmap = bmap_background;
pos_x = 70;
pos_y = 600;
layer = 1;
button = 0, 0, sitbutton, null, null, null, null, null;
flags = visible, transparent;
}

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;
}

























The only button i have in there at the moment is for the first button.


Visit us at www.m-tec-development.com WIP - Urban Conflict
Re: button problem!!! [Re: Silent_Assassin] #88303
08/31/06 09:48
08/31/06 09:48
Joined: Jan 2003
Posts: 4,305
Damocles Offline
Expert
Damocles  Offline
Expert

Joined: Jan 2003
Posts: 4,305
There is only one button: button = 0, 0, sitbutton, null, null, null, null, null;
because you have only defined one button....

btw, try: button = 0, 0, sitbutton, sitbutton, sitbutton, null, null, null;

Re: button problem!!! [Re: Damocles] #88304
08/31/06 11:41
08/31/06 11:41
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
The button has no function so how should it change something when clicked on?

quote from the manual:
Quote:


button = x, y, bmapOn, bmapOff, bmapOver, functionOn, functionOff, functionOver;
Defines a button, which can be clicked on and triggers a function.
Parameters:
x x position relative to the upper left edge of the panel
y y position relative to the upper left edge of the panel
bmapOn bitmap displayed when the button is clicked on; gives also the size of the button
bmapOff bitmap displayed when the mouse is not over the button
bmapOver bitmap displayed when the mouse is over the button

functionOn function executed if the mouse is clicked over the button
functionOff function executed if the mouse is released over the button or leaves the button
functionOver function executed if the mouse touches the button





Re: button problem!!! [Re: Xarthor] #88305
08/31/06 12:29
08/31/06 12:29
Joined: Apr 2005
Posts: 2,332
Germany, BaWü
aztec Offline

Expert
aztec  Offline

Expert

Joined: Apr 2005
Posts: 2,332
Germany, BaWü
you need something like that for a simple exit button

button = 0, 0, bmap, bmap, bmap, ex, null, null;

function ex
{
exit;
}


Visit:
schwenkschuster-design.de
Re: button problem!!! [Re: Xarthor] #88306
08/31/06 12:33
08/31/06 12:33
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
@Damocles nah that just shows the sitbutton straight away i only want it to show the sit button when i click on it but that aint working

@Thunder yeah i know it doesnt have a function...im not adding any functions yet just trying to get it to change bmap first lol


Visit us at www.m-tec-development.com WIP - Urban Conflict
Re: button problem!!! [Re: Silent_Assassin] #88307
08/31/06 12:43
08/31/06 12:43
Joined: Apr 2005
Posts: 2,332
Germany, BaWü
aztec Offline

Expert
aztec  Offline

Expert

Joined: Apr 2005
Posts: 2,332
Germany, BaWü
But you cant playe NULL instead for a bmap i think


Visit:
schwenkschuster-design.de
Re: button problem!!! [Re: Silent_Assassin] #88308
08/31/06 12:46
08/31/06 12:46
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 aztec the exit button isnt my trouble at the moment its the button on the first panel


Visit us at www.m-tec-development.com WIP - Urban Conflict
Re: button problem!!! [Re: Silent_Assassin] #88309
08/31/06 13:15
08/31/06 13:15
Joined: Sep 2003
Posts: 4,959
US
G
Grimber Offline
Expert
Grimber  Offline
Expert
G

Joined: Sep 2003
Posts: 4,959
US
your button won't change at all because your not doing anything in the above posted script to make it do anything, not even change image.

Re: button problem!!! [Re: Grimber] #88310
08/31/06 13:18
08/31/06 13:18
Joined: Apr 2005
Posts: 2,332
Germany, BaWü
aztec Offline

Expert
aztec  Offline

Expert

Joined: Apr 2005
Posts: 2,332
Germany, BaWü
Code:
 var video_mode = 8; // 800x600
var video_depth = 16; // 16 bit mode

string contestentry_wmb = <contestentry.wmb>;
bmap sitbutton = "sitbutton.bmp";
bmap sit = "sit.bmp";
bmap sleepbutton = "sleepbutton.bmp";
////////////////////////////////////////////////////////////

function main()
{
level_load (contestentry_wmb);
clip_size = 0; // show all the triangles for all the models
on_d = null; // disable the "D" key
fps_max = 40; // lock the frame rate to 40 fps
}

bmap bmap_background = <sit.bmp>;
panel panel1{
bmap = bmap_background;
pos_x = 70;
pos_y = 600;
layer = 1;
button = 0, 0, sitbutton, sitbutton, sitbutton , null, null, null;
flags = visible, transparent;
}

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;
}



maybe try this


Visit:
schwenkschuster-design.de
Re: button problem!!! [Re: aztec] #88311
08/31/06 13:28
08/31/06 13:28
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
@Silent_Assassin:
Please be more precise what your script should do exactly.
In order to have an hover effect you need to apply a DIFFERENT bmap to the bmap_over parameter of the button instruction.
(last bmap parameter is the bmap_over)

Page 1 of 4 1 2 3 4

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