1 registered members (AndrewAMD),
831
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
button problem!!!
#88302
08/31/06 09:42
08/31/06 09:42
|
Joined: Jun 2005
Posts: 734 Under your couch
Silent_Assassin
OP
Developer
|
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.
|
|
|
Re: button problem!!!
[Re: Silent_Assassin]
#88303
08/31/06 09:48
08/31/06 09:48
|
Joined: Jan 2003
Posts: 4,305
Damocles
Expert
|
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
Expert
|
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
Expert
|
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: Grimber]
#88310
08/31/06 13:18
08/31/06 13:18
|
Joined: Apr 2005
Posts: 2,332 Germany, BaWü
aztec
Expert
|
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
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|