|
Button Click function, correct version
#266356
05/17/09 16:31
05/17/09 16:31
|
Joined: Oct 2008
Posts: 112
Ness
OP
Member
|
OP
Member
Joined: Oct 2008
Posts: 112
|
hullo, i made a small example and can someone explain me ,why i cant click on the button? function main() { level_load("questimage.wmb"); camera.ambient = 100; mouse_mode = 2; enable_mouse = 1;
}
Panel motherbutton { pos_X = 55; pos_y = 55; flags =refresh,visible,d3d; button(0,0,motherboardpush,motherboardnormal,motherboardnormal,openmother,NULL,NULL); }
All images are correctly imported! BUT i cant see the "clicked" Button Form,if i click! how can i disable this? AND it doesnt react to nothing if i enter code on clicked function!!! Would be nice if someone could help me! EDIT: DONT think that i forgot something like button_clicked() on the upper part of the code! i didnt included it!
|
|
|
Re: Button Click function, correct version
[Re: Ness]
#266410
05/17/09 22:48
05/17/09 22:48
|
Joined: Apr 2006
Posts: 737 Ottawa, Canada
Ottawa
User
|
User
Joined: Apr 2006
Posts: 737
Ottawa, Canada
|
Hi! Are you using Lite-C? Try : flags = VISIBLE; // capital letters for all flags. Is your panel after main or before main? Ottawa
|
|
|
Re: Button Click function, correct version
[Re: Cowabanga]
#270096
06/06/09 08:15
06/06/09 08:15
|
Joined: May 2009
Posts: 258 Chicago
Jaeger
Member
|
Member
Joined: May 2009
Posts: 258
Chicago
|
I think this is kind of old, but oh well.. maybe he/she still needs help. Why don't you try this:
function main()
{
level_load("questimage.wmb");
camera.ambient = 100;
mouse_mode = 2;
enable_mouse = 1;
}
PANEL* motherbutton =
{
pos_x = 55;
pos_y = 55;
FLAGS = OVERLAY | VISIBLE;
button(0,0,motherboardpush,motherboardnormal,motherboardnormal,openmother,NULL,NULL);
}
I'm assuming this is only PART of your code, right? If this is all of it, you don't have a function openmother() defined, which would obviously be a problem. I've never seen "flags = d3d" or "flags = refresh" used on panels before... ever... I suggest you download the Lite-C workshops and read through the manual as you work. It will help a LOT. EDIT: Wait, are you using C-Script or Lite-C? I re-wrote the code for Lite-C. If you're just beginning programming, you should just go ahead and learn Lite-C, instead of C-script.
Last edited by Jaeger; 06/06/09 08:24.
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|