Gamestudio Links
Zorro Links
Newest Posts
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
1 registered members (AndrewAMD), 1,014 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Over lapping buttons #397812
03/23/12 19:06
03/23/12 19:06
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
FoxHound Offline OP
Expert
FoxHound  Offline OP
Expert

Joined: Jun 2004
Posts: 2,234
Wisconsin USA
I need to make a panel that is a map of the USA. With it you could select a state and choose a level. However buttons are first not suppose to over lap and since the buttons will be square they would have to overlap. I don't see a better situation using multi-panels as they are usually seen square thanks to the way it looks at the buttons.

Any ideas?


---------------------
There is no signature here.


QUIT LOOKING FOR ONE!
Re: Over lapping buttons [Re: FoxHound] #397814
03/23/12 19:14
03/23/12 19:14
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Don´t use buttons for that

Use a Bitmap with fix colors for each state.
Now readout the pixel below the mouse spot with the pixel functions and ask for the pixel BGR.
When left clicking, start a function that calls the state option for the given color ^^

example:
Code:
var fhandler = bmap_lock(bitmap1,8888);
var keyhit = 0;

[...loop here...]
if(mouse_left == 1 && keyhit == 0)
{
	pixel = pixel_for_bmap(bitmap1, pix_x, pix_y);
	pixel_to_vec(temp,NULL,8888,pixel);
	
	if(temp.red <= 10 && temp.green <= 50 && temp.blue <= 63)  //Color of Montana hit
	{call_state("Montana");}
	else if(temp.red <= 255 && temp.green <= 0 && temp.blue <= 0)  //Color of Washington hit
	{call_state("Washington");}
	else if(temp.red <= 0 && temp.green <= 255 && temp.blue <= 0)  //Color of Iowa hit
	{call_state("Iowa");}
	[...etc...]
	
	keyhit = 1; //to lock mousekey
}
else if(mouse_left == 0 && keyhit == 1) //to unlock mousekey
{
	keyhit = 0;
}


[...after loop break...]
bmap_unlock(bitmap1);



pix_x and pix_y need to be calculated from the mouse_pos on the bitmap.

Additional Tipp:
You can use a color-bitmap to check the color, and a satellite bitmap as overlay to show a map.

Last edited by Espér; 03/23/12 19:26.

Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: Over lapping buttons [Re: Espér] #397822
03/23/12 20:00
03/23/12 20:00
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
FoxHound Offline OP
Expert
FoxHound  Offline OP
Expert

Joined: Jun 2004
Posts: 2,234
Wisconsin USA
Well done. I expected this to take a bit longer to get such a good idea so it will be a bit before I can implant this. Thanks.


---------------------
There is no signature here.


QUIT LOOKING FOR ONE!

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