problem with gun picture overlay[solved]
-
- Posts: 31
- Joined: Tue Apr 12, 2005 12:20 am
problem with gun picture overlay[solved]
I used the code from the previous post of mine that was answered by trekker. Now, I found a new picture I want to use and use the code with the new gun name and the new R, G, B for the transparency and the picture comes up half and all chopy with the transparency. If you need the code and/or the picture, just tell me and i'll put it up.
Thanks. I used Photoshop C8 to find the background color(it was 30, 60, 205).
Thanks. I used Photoshop C8 to find the background color(it was 30, 60, 205).
Last edited by ViperGuy911 on Mon May 16, 2005 4:38 am, edited 1 time in total.
-
- Posts: 31
- Joined: Tue Apr 12, 2005 12:20 am
this is pretty easy. on the part on the bottom right where it says Layers, there should be a Channels tab. go to that, hit the new channels button on the bottom right of that window, and u should get an alpha channel. now, on that channel, everything that is white will appear and everything that is black will be invisible. so, in ur layers, select everything u want visible, and fill that part in white on the alpha channel only. i suggest u start out by saving this file as something else so u dont mess it alll up.
-
- Posts: 31
- Joined: Tue Apr 12, 2005 12:20 am
K. Thx. Pic edit done. How would I set it up in the code. heres my code now
Ty
Code: Select all
// Picture stuff
video::ITexture* image = driver->getTexture("m4al.jpg");
driver->makeColorKeyTexture(image,video::SColor(0,0,0,255));
// close device = false
progDeath = false;
while(device->run())
if (device->isWindowActive())
{
driver->beginScene(true, true, video::SColor(255,113,113,133));
smgr->drawAll();
// play gun shot sound
if (fire == true)
{
sound->setRepeat(false);
sound->setVolume(0.8f);
sound->play();
}
//pic stuff
driver->draw2DImage(image, core::position2d<s32>(100,150),
core::rect<s32>(0,0,665,375), 0, video::SColor(255,255,255,255), true);
if (progDeath == true)
{
device->closeDevice();
}
driver->endScene();
}
device->drop();
return 0;
}
-
- Posts: 23
- Joined: Thu Apr 14, 2005 6:59 pm
- Location: Bushland
-
- Posts: 31
- Joined: Tue Apr 12, 2005 12:20 am