Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/19/24 18:45
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (7th_zorro, AndrewAMD, TedMar), 837 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 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: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

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


Moderated by  HeelX, Spirit 

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