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.

DarkBASIC Professional Discussion / Fading images with alpha layer

Author
Message
marvin944
12
Years of Service
User Offline
Joined: 27th Aug 2013
Location:
Posted: 11th Mar 2014 17:38
I have a PNG with transparency info (it's already 50% transparent in certain places), but I need to fade that image in and out as well. is there a command like paste image that can have an extra value determining the transparency?

Dutch
GreenDixy
17
Years of Service
User Offline
Joined: 24th Jul 2008
Location: Toronto
Posted: 11th Mar 2014 17:53
I would think using a timer system would be better to do this

.:: Http://DeanWorks.Ca ::.
My software never has bugs. It just develops random features.
ShellfishGames
13
Years of Service
User Offline
Joined: 6th Feb 2013
Location:
Posted: 11th Mar 2014 17:58
I'd suggest using sprites. Sort of like this:



..if that answers your question. To determine the alpha value, a timer system might indeed be a good option. Or in case of a fixed frame rate, just a value in/decreased by constant steps each cycle.

marvin944
12
Years of Service
User Offline
Joined: 27th Aug 2013
Location:
Posted: 11th Mar 2014 19:52
Thanks, I'll give it a try.

Dutch
marvin944
12
Years of Service
User Offline
Joined: 27th Aug 2013
Location:
Posted: 11th Mar 2014 19:55
Works like a charm! I grew up with sprites on a Commodore 64 and somehow it stuck in my mind that they can't be that big or versatile. But in DBPro they have real power to do amazing effects. Thanks!

Dutch
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 13th Mar 2014 05:24
Fortunately, technology has come a long way since the C64. Although one trick I miss from those days is palette manipulation.

Login to post a reply

Server time is: 2026-07-06 04:28:11
Your offset time is: 2026-07-06 04:28:11