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 / dbSetImageColorKey is not hiding the Selected Color.

Author
Message
vitinho444
13
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 24th Jul 2011 23:58
Hey guys!

Im trying a new version of my game that its basicly everything custom.
You can make your own mods and stuff.

So i want to people put the background color with the RGB: 0, 255, 5
It is bright green and now i made a sprite with that color and the color is still there..

What's happening?

PS: The dbSetImageColorKey(0,255,5); is inside the loop and in void darkgdk startup

C++ Medium 3.5/5
VB6 Advanced: 4/5
VB.NET Advanced: 4/5
Dodga
14
Years of Service
User Offline
Joined: 12th Dec 2009
Location:
Posted: 25th Jul 2011 02:19
dbSetObjectTransparency
This command will set the transparency state of the specified object. Setting the transparency to one will ensure the object does not draw the transparent colour during final rendering. The transparent colour is determined by the dbSetImageColorKey command.

Syntax
void dbSetObjectTransparency ( int iObject, int iFlag )
JTK
14
Years of Service
User Offline
Joined: 10th Feb 2010
Location:
Posted: 25th Jul 2011 03:08
dbSetImageColorKey() must be called before loading your image too.

JTK
vitinho444
13
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 29th Jul 2011 19:30
not working both..

C++ Medium 3.5/5
VB6 Advanced: 4/5
VB.NET Advanced: 4/5
Kevin Picone
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 29th Jul 2011 20:23 Edited at: 29th Jul 2011 21:10
PNG ? - It might be assuming you want alpha channel from the image format.

Mireben
15
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 29th Jul 2011 20:42
Yes, if you saved it as PNG then that's the problem. Color key works correctly with BMP.

There is also a command to switch sprite transparency on and off:



but the default flag settings are 1,1 so it should work without this command, if you save the sprites in BMP format.
vitinho444
13
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 29th Jul 2011 22:32
they are in .idi but encrypted with png

C++ Medium 3.5/5
VB6 Advanced: 4/5
VB.NET Advanced: 4/5
Mireben
15
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 30th Jul 2011 12:57 Edited at: 30th Jul 2011 12:59
You have two choices:

1. Save the image in BMP format and use the colour key command. For this, even Windows Paint is enough, it can load PNG and save BMP.

2. Save the image in PNG format, but with transparency, and then you don't need the colour key. For this you need an image editor that can handle transparency. For example in Paint Shop Pro, when you export into PNG, you can select which will be the transparent colour and then transparency is saved into the file.

You can also check if the program that the original file was made with (I don't know what "idi" is) can export into a different format.
vitinho444
13
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 30th Jul 2011 19:20
well

i use paint.net that has transparency

but as i want players to make their graphics and i want it dynamic that allow players to make with all editors i want to use colour key but the problem is that BMP takes some space..

.idi its: Island Defender Image (a extension created for the game) that just changes in the name.

C++ Medium 3.5/5
VB6 Advanced: 4/5
VB.NET Advanced: 4/5

Login to post a reply

Server time is: 2024-05-23 12:49:22
Your offset time is: 2024-05-23 12:49:22