Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: How can i draw a texture with Alpa Transparency ?  (Read 900 times)
-Mervin-
Community Member
*
Posts: 33


« on: April 26, 2009, 10:50:38 AM »

I'm trying to draw a texture (PNG file with 8 bit transparency) for a 2D user interface.
i will use DDS files later.

TV3D 6.5 just draws the transparent parts black.

I'm using C#

How can i fix this?

Logged
SylvainTV
Administrator
Community Member
*****
Posts: 4946


WWW
« Reply #1 on: April 26, 2009, 04:08:36 PM »

How do you load the texture ?

If you're loading a transparent png file, you should use the COLORKEY_USE_ALPHA_CHANNEL flag in colorkey.
Logged

Regards

Sylvain Dupont
TrueVision3D Developer
sylvain@truevision3d.com

TV3D IRC at http://chat.truevision3d.com or on server irc.truevision3d.com #Truevision3D. Come talk with us !
-Mervin-
Community Member
*
Posts: 33


« Reply #2 on: April 26, 2009, 04:24:40 PM »

i'm loading it this way:
Code:
TextureNum = TexFac.LoadAlphaTexture(FileTemplate + SkinPart + ".png", SkinName + "_" + SkinPart);

if i would use TVTextureFactory.LoadTexture i would also have to specify a width and height and i do not want that.

i'm guessing that this won't work? :
Code:
.LoadTexture(FileTemplate + SkinPart + ".png", SkinName + "_" + SkinPart, 0, 0, CONST_TV_COLORKEY.TV_COLORKEY_USE_ALPHA_CHANNEL);

(setting the width and height to 0 )

Edit: Hmm that does seem to work, i hope it won't cause any problems.
thanks for your help.



« Last Edit: April 26, 2009, 04:27:43 PM by -Mervin- » Logged
SylvainTV
Administrator
Community Member
*****
Posts: 4946


WWW
« Reply #3 on: April 26, 2009, 06:21:53 PM »

Yea 0 or -1 for width/height uses the actual size of the texture in the file.
Logged

Regards

Sylvain Dupont
TrueVision3D Developer
sylvain@truevision3d.com

TV3D IRC at http://chat.truevision3d.com or on server irc.truevision3d.com #Truevision3D. Come talk with us !
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks