Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Help with transparency around my buttons

Author
Message
Ovan35
15
Years of Service
User Offline
Joined: 25th Sep 2009
Location:
Posted: 11th Feb 2010 12:45
Alright I\'m having trouble with my images for my buttons.I wanted just the words of the buttons to show and so I put a hot pink background around te words 255,0,255 just like the code for the transparency.But when I run the game the pink block is still around the letters.I\'ve tried changing to different formats.I started with a png file, then tried 24 bit bmp, then 16 bit bmp none of it worked.I\'ve ran other code before this and didn\'t have a problem with the transparency but this is the first time I\'ve tried to make any content myself.I\'m leaving one of the buttons here for reference maybe someone can point out what I might have done wrong from it.



It was such a small seed... I needed to find out what was growing inside. And there was only one way to find out. So I decided to raise it.

Amnzero
15
Years of Service
User Offline
Joined: 1st Aug 2009
Location:
Posted: 11th Feb 2010 13:30
dbSetImageColorkey
This command will set the general colorkey for all images. A colorkey allows you to specify a particular RGB colour that will be treated as transparent by the image when used. Transparent pixels of an image are not drawn. You must use this command before loading or grabbing an image in order that a suitable alpha map be generated from the transparent pixels of the desired image to be calculated. The alpha map is then used to decide which pixels are drawn and which pixels are never rendered.

Syntax
void dbSetImageColorKey ( int iRed, int iGreen, int iBlue )

if(enemy == Amnzero) runAway();
Amnzero->WebSite = L"http://neovance.com/";
Ovan35
15
Years of Service
User Offline
Joined: 25th Sep 2009
Location:
Posted: 11th Feb 2010 17:23
Like I said that command is already in the program.It's the default transparent color because that command comes already in the 2d program when you start a new project.I didn't erase it.But for some reason even though I made the background around my words that same hot pink color (255,,0,255), it's not working and I have no idea why not.

I looked on the forum this question has been asked before and one time solved apparently but the one instance in which it was solved the person didn't go into detail into how or what he did different.He just said it's working and left it at that.

It was such a small seed... I needed to find out what was growing inside. And there was only one way to find out. So I decided to raise it.

Ovan35
15
Years of Service
User Offline
Joined: 25th Sep 2009
Location:
Posted: 11th Feb 2010 18:03
I think I got it.I'm still not sure what I did different however but I went to paint and changed the png files to 24 bit bmp files (I did it before in photoshop not sure if that is somehow different).When I did that the colors were transparent.So apparently Dark Gdk has a problem with making png files transparent.

It was such a small seed... I needed to find out what was growing inside. And there was only one way to find out. So I decided to raise it.

Serial Velocity
16
Years of Service
User Offline
Joined: 24th Aug 2008
Location:
Posted: 11th Feb 2010 19:24
Once you set the colour key make sure you add a ,1 flag at the end of dbPasteImage(). This is to tell DarkGDK to consider alpha transparency.

Bran flakes91093
16
Years of Service
User Offline
Joined: 13th Sep 2008
Location: Crazy Land
Posted: 11th Feb 2010 20:32
Are you loading the image (it has to be a bitmap btw) after the call to dbSetImageTransparency?

Success = Determination * Mood;

Login to post a reply

Server time is: 2024-10-01 23:32:11
Your offset time is: 2024-10-01 23:32:11