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.

Newcomers DBPro Corner / A question about Image transparency

Author
Message
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 13th Apr 2008 01:44
I was using "Paste Sprite" to put 2D Images over the 3D scene I am using in the game I am writing, However I have discovered that is a very slow way of doing things and that the "Paste Image" command is infact much quicker.

My problem is, although the lovely alpha fading seems to work fine with the sprite commands, it doesn't seem to work at all with the image commands. Is this the way DBPro handles .Png files, or have I missed something and am doing something wrong?

I have tried searching the forums, but I can't find anthing which has helped me a great deal in understanding this.

Without Music or Love the world would be a very empty place... Thank god I still have music.. --'-<@
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 13th Apr 2008 21:02
Make sure the image file has the proper areas set as transparent that you want. PNG files are unaffected by the SET IMAGE COLORKEY command because they have their own alpha channel information in them.

=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 13th Apr 2008 23:23
I assume it has the alpha layer set up correctly because the transparency works as a sprite. Its only when I paste image that the transparency goes wrong.

Without Music or Love the world would be a very empty place... Thank god I still have music.. --'-<@
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 14th Apr 2008 00:47 Edited at: 14th Apr 2008 00:52
make sure you're including the transparency flag when you paste the image.

ie, paste image ID,300,300,1

add it when you load the image as well:

load image "myimage.png",1,1

if that doesn't work, then there may be an issue with your .png file and you should attach it so we can take a look at it.

ps: what you want to achieve is completely possible (and simple) so don't give up. just needs a little ironing out. here's a quick example of 2 png files displayed over a 3d sphere using both paste image and sprite:



Virtual Nomad
AMD XP 1800+ (~1.6 Ghz) / 1.5 GB RAM
ATI Radeon 8700LE 128 MB / Windows XP

Attachments

Login to view attachments
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 14th Apr 2008 03:04
@Virtual Nomad

Thankyou thankyou thankyou thankyou

I'd not added the transparency flag to the "Paste image" commands when I changed them over.

It now works perfectly again.

Without Music or Love the world would be a very empty place... Thank god I still have music.. --'-<@

Login to post a reply

Server time is: 2024-11-25 06:25:02
Your offset time is: 2024-11-25 06:25:02