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 / Sprite help?

Author
Message
one must fall
18
Years of Service
User Offline
Joined: 29th Aug 2006
Location:
Posted: 20th Oct 2007 06:22
I've actually been using dbpro for a little while now, and decided to go into 2d stuff. But, when i try to load a sprite into the game, everything goes ok, but i get the sprite's backround in it. Is there some way i could make that transparent?
HeavyAmp
17
Years of Service
User Offline
Joined: 25th Oct 2006
Location: Castle in the Sky!
Posted: 20th Oct 2007 07:08
Pixels that have a color of RGB(0,0,0) Black wont be show on a sprite . So just make the background color of your image 0,0,0.

Better to be dead, than to live your life afraid.
Zergei
19
Years of Service
User Offline
Joined: 9th Feb 2005
Location: Everywhere
Posted: 20th Oct 2007 07:16 Edited at: 20th Oct 2007 07:17
Also check the SET CURRENT COLORKEY command, which allows you to define the transparent color, in case you use other than black. (My case is some sort of violet "255,0,255")

Further on my stuff at...
TurboSquid.com
The3dStudio.com
Clackersmith
21
Years of Service
User Offline
Joined: 4th Sep 2003
Location:
Posted: 20th Oct 2007 07:23 Edited at: 20th Oct 2007 07:25
I personal like to use .PNG images for all my sprites. They will retain their alpha channel data when loaded. So providing they have been set up correctly in Photoshop or some other program that will allow you to set specific "alpha areas" of an image, you shouldn’t have to do anything in terms of setting transparence once the image has been loaded.

Just to add a little extra to what HeavyAmp is saying -
The 'set image colorkey R,G,B' function will allow you to define which colour of an image you wish not to be rendered (Default=RGB(0,0,0)).

But like I said I personal would use either a .PNG .TGA or a .DDS file because they support 255 levels of transparency unlike the standard 1.

one must fall
18
Years of Service
User Offline
Joined: 29th Aug 2006
Location:
Posted: 20th Oct 2007 07:34
Thanks, now it works!
Clackersmith
21
Years of Service
User Offline
Joined: 4th Sep 2003
Location:
Posted: 20th Oct 2007 07:42 Edited at: 20th Oct 2007 07:50
Here is a quick image a whipped up to show the difference between the default transparency and using a .PNG with 255 levels of alpha.



Apart from the obvious lack of transparency on the red box you should also be able to see a black outline around the "Alpha Test" text on the .BMP image.

Login to post a reply

Server time is: 2024-09-27 05:07:07
Your offset time is: 2024-09-27 05:07:07