Gamestudio Links
Zorro Links
Newest Posts
What are you working on?
by rayp. 10/15/25 20:44
Help!
by VoroneTZ. 10/14/25 05:04
Zorro 2.70
by jcl. 10/13/25 09:01
ZorroGPT
by TipmyPip. 10/12/25 13:58
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 10/11/25 18:45
Reality Check results on my strategy
by dBc. 10/11/25 06:15
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (AndrewAMD, 1 invisible), 7,036 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
joenxxx, Jota, krishna, DrissB, James168
19170 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
pan_setbutton drawn layers #365143
03/23/11 17:11
03/23/11 17:11
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline OP
Serious User
MrGuest  Offline OP
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
when creating buttons that overlap using pan_setbutton, clicking will activate the first one created but the engine will render the second button created on top.
Code:
///////////////////////////////
#include <acknex.h>
#include <default.c>

///////////////////////////////

var var_id;

void pnl_test(var id, PANEL* p){
	
	var_id = id;
	beep();
}

void main(){
	
	wait(1);
	
	PANEL* pnl = pan_create("", 1);
	
	pnl.bmap = bmap_createblack(200, 200, 32);
	bmap_fill(pnl.bmap, COLOR_RED, 100);
	
	set(pnl, SHOW);
	
	BMAP* bmp_bg = bmap_createblack(50, 200, 32);
	bmap_fill(bmp_bg, COLOR_GREEN, 100);
	
	pan_setbutton(pnl, 0, 1, 0, 0, bmp_bg, bmp_bg, bmp_bg, bmp_bg, pnl_test, NULL, NULL);
	
	BMAP* bmp_fg = bmap_createblack(200, 50, 32);
	bmap_fill(bmp_fg, COLOR_BLUE, 100);
	
	pan_setbutton(pnl, 0, 1, 0, 0, bmp_fg, bmp_fg, bmp_fg, bmp_fg, pnl_test, NULL, NULL);
	
	mouse_mode = 4;
	
	while(1){
		
		DEBUG_VAR(var_id, 240);
		wait(1);
	}
}

it's possible to use multiple panels to overcome this but not exactly practiable.

Cheers!
MrGuest

Re: pan_setbutton drawn layers [Re: MrGuest] #367264
04/11/11 13:34
04/11/11 13:34
Joined: Jul 2000
Posts: 28,028
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,028
Frankfurt
Buttons must not overlap on the same panel.


Moderated by  HeelX, Spirit 

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