Page 1 of 1

[Bug?] Custom Portraits - Champion:setPortrait()

Posted: Thu Sep 20, 2012 9:38 am
by djoldgames
Trying to set custom portrait for default party by function Champion:setPortrait(), brings the D3DError message if in parameter is TGA file (in my example is the path to your own portraits_background.tga, just for sure this is the valid TGA).

Image

When I convert portraits to DDS format (D3DFMT_A8R8G8B8 - uncompressed) as custom assets, there is no error, but in game portraits are Empty.
But in Scripting Reference is setPortrait() described for using TGA format...

Thank you for answer

Re: [Bug?] Custom Portraits - Champion:setPortrait()

Posted: Thu Sep 20, 2012 10:40 am
by petri
The scripts refer to texture assets as *.tga. The files themselves have to be in dds format and have the dds extension. The engine will substitute tga with dds in filenames on the fly. It is this way because that's how our internal asset pipeline works.

You are probably missing the alpha channel or the alpha channel is black in the dds file. Black alpha = transparent pixel.