PT(TextureStage) ts = new TextureStage(“ts”);
ts->set_mode(TextureStage::M_decal);
Texture *a = TexturePool::load_texture(mydir+"/button.bmp");
texture.set_texture(a);
//not working with or without this line:
texture.set_transparency(TransparencyAttrib::M_alpha);
//second approach: card is NodePath as well:
//cm is the card generator
I don’t see anything obviously wrong with your code, though I don’t know precisely what’s going wrong or what you expect to happen. Note that alpha is not supported by our bmp and tga loader, but it is supported by png. However, Photoshop sometimes writes an additional png channel which confuses the alpha channel, so you do have to be careful there. Try using GIMP to verify that the png alpha channel is written correctly; or simply load the png file in pview with the command line “pview button.png”. You should see gray (the window background color) where the alpha values are 0.