Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / Transparency problem

Author
Message
ArcAngel
21
Years of Service
User Offline
Joined: 18th Oct 2003
Location:
Posted: 3rd Aug 2005 02:30 Edited at: 3rd Aug 2005 02:33
I'm having a bit of trouble with a transparent (or suppose to be for that matter...) sprite. I understand the fact that DBPro takes out everything with the values of RGB(0,0,0). I've repainted the back of this sprite dozens of times with pitch black and yet some pixels still show up! I use graphics gale. Here's what I'm talking about:
Can anyone help? I've come to the conclusion that it's the editor, but like I said, i've redone it a few times.

Oh just to let you know, the blue you see is the background behind the sprite (it's a sky) and the pink is to a reference to show that graphics gale actually filled it in. The other side I did the exact same thing only black. But look what happened! I even went over it useing fill boxes. Do I need to do it pixel by pixel???

Attachments

Login to view attachments
pizzaman
21
Years of Service
User Offline
Joined: 18th Feb 2004
Location: Gateshead, UK
Posted: 3rd Aug 2005 02:44
Do not use a .jpg image as your sprite or you'll get results like that, try .png images (the best) or use .bmp, but make sure you repaint all the squares to pure black before you convert the image.

ArcAngel
21
Years of Service
User Offline
Joined: 18th Oct 2003
Location:
Posted: 3rd Aug 2005 04:27 Edited at: 4th Aug 2005 04:12
EDIT

Sry, I thought it would work and posted before I tried it (seeing that it sounded like it made sense and I've solved stuff like that before using that method too...). Unfortunatly that didn't do the trick. The code generally looks like this

load image "arc1.tga", 1
sprite 1,300,300,1
set sprite

Normally you would see the black background (because DB's natural window color for program is black) but I have a bitmap background behind it so the black does come out. I've tried that method, doesn't work. Maybe all the images on the screen have to be the same file type... i'll check that soon. I also haven't tried bitmap...

Please Help!
BlinkOk
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location:
Posted: 3rd Aug 2005 06:15
does that mean that dbpro will only do "index" transparency and not "alpha" transparency?

P4 2.8Ghz, 2Gb, 128Mb Radeon Pro, Dark Basic PRO
ArcAngel
21
Years of Service
User Offline
Joined: 18th Oct 2003
Location:
Posted: 4th Aug 2005 04:13
Ok, found the problem. None of those file types work for transparency. Turns out bitmaps are the only file type that can be transparent (or at least thats my case).
BlinkOk
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location:
Posted: 4th Aug 2005 10:50
i got it workin ok. this is a .png image generated by "particle illusion" with alpha transparency displayed upon a .jpg background.
download the attached .zip and run this code on it.
i'm a noob when it comes to coding so there is prolly better ways of doing this however the texture flasg for the load image command should always be set ot 1

P4 2.8Ghz, 2Gb, 128Mb Radeon Pro, Dark Basic PRO

Attachments

Login to view attachments
ArcAngel
21
Years of Service
User Offline
Joined: 18th Oct 2003
Location:
Posted: 4th Aug 2005 16:33
hmmm... thats weird... I wonder why I'm having trouble with that.
pizzaman
21
Years of Service
User Offline
Joined: 18th Feb 2004
Location: Gateshead, UK
Posted: 4th Aug 2005 18:43
Let me clear up a few things for you.

1. Never use .jpg images for anything they are rubish, I would recommend using .png's as they have a built in alpha channel and have a quite low file size.
2. When using images to do anything with 2D use the extra 1 flag on the load image command.
3. Depending on whether the image format has an alpha channel, DBP will load them slightly differently. For example if the image format is a .bmp (which usually do not have an alpha channel), DBP will make any pure black parts transparent (unless a different colour is specified). However if you use a format such .png (which contain an alpha channel), DBP will hide all the transparent parts and will not make pure black transparent.

See the example demo to see what I mean about the transparency.

Attachments

Login to view attachments
UnderLord
21
Years of Service
User Offline
Joined: 2nd Aug 2003
Location:
Posted: 9th Aug 2005 16:02
YesBMP's are the best for transparency in this case. I always use BMP's of 2d spaceships if i want them to be transparent.

When we talk to god, we're praying. When god talks to us, we're schizophrenic.

Login to post a reply

Server time is: 2025-05-17 18:43:52
Your offset time is: 2025-05-17 18:43:52