|
|
Re: Why is my panel event not being called??
[Re: Caermundh]
#286492
08/25/09 14:17
08/25/09 14:17
|
Joined: Mar 2006
Posts: 3,538 WA, Australia
JibbSmart
Expert
|
Expert
Joined: Mar 2006
Posts: 3,538
WA, Australia
|
What about the global variable "enable_mouse"? It's supposed to default to "1" (events on left-click) but perhaps elsewhere in your code it has been changed to "0"?
Jibb
Formerly known as JulzMighty. I made KarBOOM!
|
|
|
Re: Why is my panel event not being called??
[Re: Caermundh]
#286522
08/25/09 16:37
08/25/09 16:37
|
Joined: Apr 2006
Posts: 737 Ottawa, Canada
Ottawa
User
|
User
Joined: Apr 2006
Posts: 737
Ottawa, Canada
|
Hi! Why are you not using buttons?  bmapOn Bmap displayed when the button is switched on; gives also the size of the button. bmapOff Bmap displayed when the the button is switched off. bmapOver Bmap displayed when the mouse is over the button.
Hope this helps! Ottawa  Ver 7.86.2 Pro and Lite-C
|
|
|
Re: Why is my panel event not being called??
[Re: Caermundh]
#286539
08/25/09 18:44
08/25/09 18:44
|
Joined: Apr 2006
Posts: 737 Ottawa, Canada
Ottawa
User
|
User
Joined: Apr 2006
Posts: 737
Ottawa, Canada
|
Hi!
I think that a mixture of both is needed. I haven't tested this, but I think that the buttons would follow the panel.
Hope this helps! Ottawa  Ver 7.86.2 Pro and Lite-C
|
|
|
Re: Why is my panel event not being called??
[Re: Ottawa]
#286545
08/25/09 19:35
08/25/09 19:35
|
Joined: Dec 2006
Posts: 1,086 Queensland - Australia
Nidhogg
Serious User
|
Serious User
Joined: Dec 2006
Posts: 1,086
Queensland - Australia
|
Just a stab in the dark but try using a prototype at the begining of your code
for function panel_clicked()
Windows XP SP3 Intel Dual Core CPU: E5200 @ 2.5GHz 4.00GB DDR3 Ram ASUS P5G41T-M LX PCIE x16 GeForce GTS 450 1Gb SB Audigy 4 Spyware Doctor with AntiVirus
|
|
|
Re: Why is my panel event not being called??
[Re: Caermundh]
#286735
08/26/09 20:25
08/26/09 20:25
|
Joined: Apr 2006
Posts: 737 Ottawa, Canada
Ottawa
User
|
User
Joined: Apr 2006
Posts: 737
Ottawa, Canada
|
Hi! Here's the code that I tested today.
///////////////////////////////
#include <acknex.h>
#include <default.c>
/////////////////////////////// my mouse code
#include "mi_souris.c"
////////////////////// ---- my folders
#define PRAGMA_PATH "..\\Models";
#define PRAGMA_PATH "..\\des_tga";
#define PRAGMA_PATH "..\\des_pcx";
#define PRAGMA_PATH "..\\panels";
#define PRAGMA_PATH "..\\sons_stereo"; //son_wav
#define PRAGMA_PATH "..\\son_wav";
//
BMAP* chrono_rec = "chrono_rec.pcx"; //my pcx picture
BMAP* b_fire = "fire.tga"; // tga picture for the button
//////////////////////////////////
PANEL* my_panel_1 = {
bmap = chrono_rec;
event = pan_event_1;
scale_x = -0.5;
scale_Y = -0.5;
button (50, 50, b_fire,b_fire,b_fire,NULL,NULL,NULL);
flags = SHOW;
}
///////////////////////////////
// panel event
function pan_event_1 ()
{
while (mouse_left)
{
my_panel_1.pos_x = mouse_pos.x;
my_panel_1.pos_y = mouse_pos.y;
wait (1);
}
}
function main() // main from code templates
{
vec_set(screen_size,vector(800,400,0));
vec_set(screen_color,vector(50,1,1)); // dark blue
vec_set(sky_color,vector(50,1,1)); // dark blue
video_window(NULL,NULL,0,"Moving a panel on the screen.");
level_load("");
ma_souris (); // my mouse code
vec_set(camera.x,vector(-250,0,50));
vec_set(camera.pan,vector(0,-15,0));
}
This moves the panel and the button over the screen. When I touched the button the panel event was not activated. Change the bmaps names and this should work.
Hope this helps! Ottawa  Ver 7.86.2 Pro and Lite-C
|
|
|
|