Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (SBGuy), 652 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Ignore alpha channel in Bitmap #365957
03/30/11 18:18
03/30/11 18:18
Joined: Apr 2008
Posts: 650
Sajeth Offline OP
User
Sajeth  Offline OP
User

Joined: Apr 2008
Posts: 650
Hello,
how can I tell the engine to ignore the alpha channel of a panel bitmap?
I'd like to have it fully solid and only use the alpha channel for collision processing.
Is this possible?


Teleschrott-Fan.
Re: Ignore alpha channel in Bitmap [Re: Sajeth] #365958
03/30/11 18:37
03/30/11 18:37
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
You can ignore the alpha channel of a bitmap by assigning a material to it, that has its PASS_SOLID flag set. This will render the bitmap as if the alpha channel wasn't there.

However, I have no clue what you mean by "use the alpha channel for collision processing". That does not make any sense to me. Could you explain that in more detail?


Always learn from history, to be sure you make the same mistakes again...
Re: Ignore alpha channel in Bitmap [Re: Uhrwerk] #365962
03/30/11 19:15
03/30/11 19:15
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
Hey Sajeth,

I created a function for testing if mouse clicked on alpha layer over 10
Code:
void billboard_click(PANEL* pnl){
	
	if(var_bullets){
		
		var alpha;
		var format = bmap_lock(pnl.bmap, 0);
		
		int x = (mouse_pos.x - pnl.pos_x) / pnl.scale_x;
		int y = (mouse_pos.y - pnl.pos_y) / pnl.scale_y;
		var pixel = pixel_for_bmap(pnl.bmap, x, y);
		COLOR col;
		
		pixel_to_vec(col, alpha, format, pixel);
		bmap_unlock(pnl.bmap);
		
		
		if(alpha > 10){
			kill_handler(pnl, pnl.scale_x, pnl.pos_y);
		}else{
		}
	}
}

hopefully it's easy enough to understand

Re: Ignore alpha channel in Bitmap [Re: MrGuest] #365965
03/30/11 20:02
03/30/11 20:02
Joined: Apr 2008
Posts: 650
Sajeth Offline OP
User
Sajeth  Offline OP
User

Joined: Apr 2008
Posts: 650
I was going to do exactly what MrGuest coded, but I want the panel to be solid, no matter what the alpha channel says - so the panel rendering process just ignores the alpha channel and renders the bitmap with no transparency anyways.

Well, looks like I'd just have to use a separate file for this...

Originally Posted By: Uhrwerk
You can ignore the alpha channel of a bitmap by assigning a material to it, that has its PASS_SOLID flag set. This will render the bitmap as if the alpha channel wasn't there.

However, I have no clue what you mean by "use the alpha channel for collision processing". That does not make any sense to me. Could you explain that in more detail?

Material geht leider schlecht, weilsn Panel ist - ich will den Alphakanal manuell auslesen und für die Kollisionserkennung benutzen, die Bitmap an sich soll aber dargestellt werden, als hätte sie keinen - also ohne Transparenz laugh

Last edited by Sajeth; 03/30/11 20:04.

Teleschrott-Fan.
Re: Ignore alpha channel in Bitmap [Re: Sajeth] #365966
03/30/11 20:14
03/30/11 20:14
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Yeah, taking a separate file looks like the most reasonable approach for me as well, if you need the bitmap for a panel.


Always learn from history, to be sure you make the same mistakes again...

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