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.

2D All the way! / Colorkey / Transparency issue [DB Pro]

Author
Message
BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 2nd Nov 2005 11:58
I have a problem... I have a handful of sprites which are faded out to nothing over a second or so. I can do this. HOWEVER...All the balck pixels are being colour keyed out, so they are fully transparent from the start.

Is it possible to have alpha-faded sprites, and no colour key transparency? Or am I asking too much?

Zergei
21
Years of Service
User Offline
Joined: 9th Feb 2005
Location: Everywhere
Posted: 2nd Nov 2005 15:08 Edited at: 2nd Nov 2005 15:11
If your trying to do this in DbPro...

then try playing with the SET SPRITE ALPHA command. Also the SET IMAGE COLORKEY allows you to choose wich color would be transparent, but have in mind you must do this before loading/grabing any images....
BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 2nd Nov 2005 17:56 Edited at: 2nd Nov 2005 17:57
I am using SET SPRITE ALPHA to fade the sprite out. I can't change the image colour key for 2 reasons, both linked:

1. The user can load their own images, so I don't know beforehand what the colours will be.

2. Colour key affects all images, of which I have at least 20, with pretty much every colour in

Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 2nd Nov 2005 18:59
You can use the "set sprite" command to turn off the transparency for the sprite.
BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 2nd Nov 2005 20:55
Yes, but that prevents the alpha command from working. I really need to disable the colour key without affecting the alpha.

Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 2nd Nov 2005 22:13
Hmmm... maybe putting the image in a memblock and changing all the colors from true black to 5,5,5 instead.
BlinkOk
22
Years of Service
User Offline
Joined: 22nd Oct 2003
Location:
Posted: 2nd Nov 2005 22:44 Edited at: 3rd Nov 2005 01:12
i wonder if it has to do with the images being loaded in as textures. do you set the texture flag for the image to 1?

P4 2.8Ghz, 2Gb, 128Mb Radeon Pro, Dark Basic PRO
Peter H
22
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 3rd Nov 2005 01:05
what teh Grog said seems reasonable (though i don't see why you can't change it to rgb(1,1,1) instead )

"We make the worst games in the universe."

BlinkOk
22
Years of Service
User Offline
Joined: 22nd Oct 2003
Location:
Posted: 3rd Nov 2005 01:41
this works for me. graphics attached.

sorry bout the image quality

P4 2.8Ghz, 2Gb, 128Mb Radeon Pro, Dark Basic PRO
Zergei
21
Years of Service
User Offline
Joined: 9th Feb 2005
Location: Everywhere
Posted: 3rd Nov 2005 04:01
I think i kind of understand your problem, from some point of view. Are ya trying to do some kind of picture viewer of some sort, or something alike?, that may seem reasonable for what you ask of no colorkey, and in some way the alpha thingy. I'd advice you to do just as Grog said, use memblocks, but as far as i know memblocks may turn your prog somewhat slow....
Zergei
21
Years of Service
User Offline
Joined: 9th Feb 2005
Location: Everywhere
Posted: 3rd Nov 2005 04:03 Edited at: 3rd Nov 2005 04:04
Double post wasn't ment to be done, sorry. (if possible delete this one)
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 3rd Nov 2005 04:56
Quote: "what teh Grog said seems reasonable (though i don't see why you can't change it to rgb(1,1,1) instead )"


It'll work as long as it's not 0,0,0.
BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 3rd Nov 2005 10:14
I'll do the memblock thang. Memblocks won't slow it down, I can get 500 FPS + using memblock manipulation of an 800 * 600 screen Plus, it will only be in a setup screen, not in-game.

BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 8th Nov 2005 14:33 Edited at: 8th Nov 2005 14:37
If anyone wants to use this solution, here it is. The nested if statements are intentional. DB Pro processes all ANDs, even if the first is false.



Login to post a reply

Server time is: 2026-07-06 18:57:30
Your offset time is: 2026-07-06 18:57:30