#166703 - hacker013 - Sun Feb 15, 2009 1:21 pm
hey,
i know to set the alpha to 1 with this code:
Code: |
black = RGB15(0,0,0)|(1<<15);
|
but how do i set the apha to 0 so i get a transparent color. i need this so nitro engine only draws the outlineing of the font.
_________________
Website / Blog
Let the nds be with you.
#166708 - vuurrobin - Sun Feb 15, 2009 3:27 pm
I think this will do it:
Code: |
black = RGB15(0,0,0) & (!(1<<15)); |
haven't tested it tho.
#166711 - a128 - Sun Feb 15, 2009 6:15 pm
after I talked to my lab department. and spent about 3h for the solution...here is the final result:
black=0 //fully translucent
#166722 - albinofrenchy - Sun Feb 15, 2009 11:58 pm
Uhh... When in doubt do ARGB16(A,R,G,B).
But the results of a128's lab time is indeed correct. :)
#166866 - silent_code - Sat Feb 21, 2009 12:44 pm
~ is a bitwise operator. ! is a logical operator. They get mixed up easily under certain circumstances... ;^)
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.
#166872 - hacker013 - Sat Feb 21, 2009 4:09 pm
a128 wrote: |
after I talked to my lab department. and spent about 3h for the solution...here is the final result:
black=0 //fully translucent |
it is still drawing the font black :(
_________________
Website / Blog
Let the nds be with you.
#166879 - AntonioND - Sat Feb 21, 2009 11:26 pm
hacker013 wrote: |
a128 wrote: | after I talked to my lab department. and spent about 3h for the solution...here is the final result:
black=0 //fully translucent |
it is still drawing the font black :( |
Are you loading the texture as a RGB texture? You have to load it as RGBA.
#166885 - hacker013 - Sun Feb 22, 2009 12:47 pm
if loaded it with your BMPtoRGBA function :)
_________________
Website / Blog
Let the nds be with you.
#166887 - a128 - Sun Feb 22, 2009 7:02 pm
hacker013 wrote: |
if loaded it with your BMPtoRGBA function :) |
post it so we can have a look at the code
#166889 - AntonioND - Sun Feb 22, 2009 9:45 pm
hacker013 wrote: |
if loaded it with your BMPtoRGBA function :) |
That function does only convert the BMP file into a texture, how do you load the texture?
#166897 - hacker013 - Mon Feb 23, 2009 9:51 am
This is how load it:
Code: |
NE_Material* MaterialFont;
MaterialFont = NE_MaterialCreate();
NE_FATMaterialTexLoadBMPtoRGBA(MaterialFont, "/urazelda/font.bmp", 1);
NE_TextInit(0,MaterialFont,8,14);
|
This is how i use it:
Code: |
/* Draw Text */
NE_TextPrintFree(0,31,15,NE_White,"Please select a file.");
NE_TextPrintFree(0,50,46,0,"File 1");
NE_TextPrintFree(0,50,66,0,"File 2");
NE_TextPrintFree(0,50,86,0,"File 3");
NE_TextPrintFree(0,50,110,0,"Copy");
NE_TextPrintFree(0,50,130,0,"Erase");
NE_TextPrintFree(0,50,154,0,"Options");
|
_________________
Website / Blog
Let the nds be with you.
#166901 - AntonioND - Mon Feb 23, 2009 4:10 pm
The transparent color is the one in the upper left corner of your bmp. Have you checked if it is the same as the other pixels you want to make transparent?
#166902 - hacker013 - Mon Feb 23, 2009 4:59 pm
no, because the outlinening from the font is black, and the font color is white and the transparent color of the font is blue. So when i draw the font red it draws the font red with black outlinening and also with other colors but when i want to draw only the outlinenig from the font it draws it totaly black.
_________________
Website / Blog
Let the nds be with you.