Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
1 registered members (AndrewAMD), 599 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 3 1 2 3
button in panel only works at pos(0,0) #398436
04/02/12 06:27
04/02/12 06:27
Joined: Mar 2009
Posts: 20
A
atlee Offline OP
Newbie
atlee  Offline OP
Newbie
A

Joined: Mar 2009
Posts: 20
Have a panel which serves as a button on top of another panel. The button panel works when positioned at pos_x = 0; pos_y = 0;
However when I move the button to the bottom of the panel or any where else, the button no longer calls the function when clicked.

The code is as follows:

PANEL* gpsfasetup_pan = //this is the main panel
{

layer = 30;
bmap = gpsfasetup_bmp;
flags = SHOW;
}

PANEL* quitprogrambutt_pan = //this is the button
{
pos_x= 0;
pos_y = 0;
layer=35;
bmap = quitprogrambutt_bmp;
flags = SHOW;
event = quitprogram();

}
The main panel bitmap covers the entire window so the button
is not outside the main panel.
There is nothing in the manual that addresses this problem.
Any help appreciated.

Re: button in panel only works at pos(0,0) [Re: atlee] #398441
04/02/12 07:46
04/02/12 07:46
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
try to modify this line:

event = quitprogram();

to this:

event = quitprogram;

it should work laugh


Free world editor for 3D Gamestudio: MapBuilder Editor
Re: button in panel only works at pos(0,0) [Re: sivan] #398444
04/02/12 08:13
04/02/12 08:13
Joined: Mar 2009
Posts: 20
A
atlee Offline OP
Newbie
atlee  Offline OP
Newbie
A

Joined: Mar 2009
Posts: 20
I tried that (removing parens). It made
no difference.

Re: button in panel only works at pos(0,0) [Re: atlee] #398450
04/02/12 09:45
04/02/12 09:45
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
Try on_click instead of event? Maybe that helps.

on_click = quitprogram;

Re: button in panel only works at pos(0,0) [Re: Widi] #398455
04/02/12 11:08
04/02/12 11:08
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
As an guess ... is "quitprogrambutt_bmp" a 32-bit image or 24bit?

If its a 32-bit, then maybe the alpha channel is allowing you to
un-intentionally click 'through' the panel?

Try (temporarily) setting the bmap to a 24-bit image just as a test...


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: button in panel only works at pos(0,0) [Re: EvilSOB] #398489
04/02/12 20:20
04/02/12 20:20
Joined: Mar 2009
Posts: 20
A
atlee Offline OP
Newbie
atlee  Offline OP
Newbie
A

Joined: Mar 2009
Posts: 20
All bitmaps are 24-bit. Verified this.
Just out of curiosity, I added this to the main bitmap panel:

button(0,0,quitprogrambutt_bmp,NULL,NULL,quitprogram,NULL,NULL)

I could move the quit program button around the main bitmap and it functioned. Unfortunately, this only works for one button and I need three on the main bitmap. If I try to add a second button, the first (quit program) button disappears and the second button makes the function call to the first button's function instead of the function assigned to the second.

Nothing in the manual on this. Anyone know what's going on?
I'm using A& 7.86 lite-c.

Re: button in panel only works at pos(0,0) [Re: atlee] #398510
04/02/12 23:35
04/02/12 23:35
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Try it with your 'floating' buttons JUST like this as let us know how it goes..
Code:
PANEL* quitprogrambutt_pan = //this is the button
{
   layer=35;
   button(0,0,quitprogrambutt_bmp,NULL,NULL,quitprogram,NULL,NULL)
   flags = SHOW;
}


And try it with multiple buttons activating a DIFFREENT function each first...


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: button in panel only works at pos(0,0) [Re: EvilSOB] #398512
04/03/12 00:51
04/03/12 00:51
Joined: Mar 2009
Posts: 20
A
atlee Offline OP
Newbie
atlee  Offline OP
Newbie
A

Joined: Mar 2009
Posts: 20
Tried that but no joy, no button appears on the main bitmap. Need
to add the bmap = quitprogrambutt_bmp to see it but then it doesn't work anyway even if I add the event code on to the button panel. The only thing that makes the button work is the button function code on the main panel. But this will only work with a single button. No other button is allowed to appear on the main bitmap if I have the button function code in the main bitmap (see the gpsfasetup_pan code above). It is also interesting that the event code in a button panel doesn't work either. With C-Script, a simple on_click was all that was needed to get buttons to work.

Re: button in panel only works at pos(0,0) [Re: atlee] #398517
04/03/12 10:29
04/03/12 10:29
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
don't panic buttons work! maybe your event function is improper... if you copy that here we could help.

Code:
PANEL* ui_mainmenu_panel =
{
	flags = SHADOW | OVERLAY;		// | TRANSLUCENT
//	alpha = 75;	// if translucent panel is needed
	pos_x = 0; 
	pos_y = 736;
	bmap = panel_image_bmp;		//"panel.dds";
	layer = 10;	
	
	button( 10, 10, on_bmp, off_bmp, over_bmp, function_to_call ,NULL,NULL);

}




Free world editor for 3D Gamestudio: MapBuilder Editor
Re: button in panel only works at pos(0,0) [Re: sivan] #398523
04/03/12 12:33
04/03/12 12:33
Joined: Sep 2007
Posts: 101
Luxembourg
K
krial057 Offline
Member
krial057  Offline
Member
K

Joined: Sep 2007
Posts: 101
Luxembourg
I'm pretty sure that you have not set the correct mouse_mode. Try setting the mouse_mode to 4 and it will work grin

Last edited by krial057; 04/03/12 12:39.
Page 1 of 3 1 2 3

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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