Gamestudio Links
Zorro Links
Newest Posts
Zorro version 3.0 prerelease!
by Grant. 02/24/26 22:21
WFO Training with parallel cores Zorro64
by Martin_HH. 02/24/26 19:51
ZorroGPT
by TipmyPip. 02/23/26 21:52
Camera always moves upwards?
by clonman. 02/21/26 09:29
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/19/26 13:22
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
5 registered members (TipmyPip, clint000, Grant, chsmac85, Martin_HH), 5,858 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
alx, ApprenticeInMuc, PatrickH90, USER0328, Sfrdragon
19199 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
TGA with alpha - opacity in script #48606
07/01/05 12:12
07/01/05 12:12
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
ulillillia Offline OP
Senior Expert
ulillillia  Offline OP
Senior Expert

Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
When making an image in the GIMP 2.2.7, with TGA alpha channel, when I set the object's alpha at 50, it, for some odd reason, was 100% visible. My script (part of it):

Code:

panel flare2
{
layer = 28;
alpha = 25; // 50% transparent for some reason
flags = transparent;
}



The bmap is set through a function and the bmap is a TGA file with alpha channel. The same thing also occurs with text using fonts that have alpha channel:

Code:

text beta_version_markers
{
pos_x = 192;
pos_y = 0;
layer = 35;
font = digital_octagon_bold_double;
string = "BETA - VERSION 1\nBETA - VERSION 1";
flags = visible, transparent;
alpha = 25; // 50% transparent for some reason
}



How do I know that an alpha of 25 is actually 50 and that 50 is fully transparent? Try using a black background and a white bmap and set the alpha accordingly. Take a screenshot (using the print screen key as using F6, because of the JPG stuff, will mess it up) of it. 50 has the bmap's color as very close to 255 for the r, g, and b colors. Using 25 gets you closer to 128 for r, g, and b. Normally, 50 should use 128 and 25 should use 64.

To reproduce:
1. Create an image, with alpha channel that is all white and fully visible and of substantial size (like 256x256).
2. Write a script to make the bmap transparent and set the alpha to 50.
3. Run the engine in windowed mode (full screen may cause problems) and take a screenshot using the prtscr key to the right of the F12 key.
4. Open MSPaint and paste the screenshot in there.
5. Use the eye dropper tool and select the white.
6. Set the alpha in the script to 25 and repeat steps 3 to 5.
7. Set the alpha to other values as you please.
8. Create another image, without alpha channel that is all white and repeat steps 2 though 7. This time, alpha works like it should.


"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip My 2D game - release on Jun 13th; My tutorials
Re: TGA with alpha - opacity in script [Re: ulillillia] #48607
07/01/05 12:24
07/01/05 12:24
Joined: Jul 2000
Posts: 28,075
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,075
Frankfurt
Because alpha = 50 is the default value, meaning that TGA files have then their normal transparency. To make them 'more transparent' as they already are, use alpha values below 50. I admit that this is not clearly described in the manual, we'll add this information.

Re: TGA with alpha - opacity in script [Re: jcl] #48608
07/01/05 12:29
07/01/05 12:29
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
ulillillia Offline OP
Senior Expert
ulillillia  Offline OP
Senior Expert

Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
Then, if something isn't transparent at all, from the image file, why does 50 make it half transparent? This don't make sense. 50, yes, is the default, but wouldn't that affect everything, making even transparent objects 50% more transparent than they actually are? It's unusual and confusing. When one thinks about it, setting something that's already transparent to 50% transparency would make it 50% more transparent when, normally, if something is fully transparent, it'd become 50% transparent. It don't make sense and is illogical.


"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip My 2D game - release on Jun 13th; My tutorials

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