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! / .png transparency fades

Author
Message
Lampton Worm
22
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United Kingdom
Posted: 11th Mar 2004 11:16
Hi,

Does anyone have an example (image+code) of a high colour png loaded into DP and displayed as a sprite, but with more than 1 level of transparency? I've tried a few things in PSP but the best I have so far is a 16m png but only 1 transparent colour. I'd like to know to create a transparent fade.

Cheers in advance
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 11th Mar 2004 17:08
Misread request and done transparent png but for 3d stuff.

Download here: http://www.dbhut.com/zips/pngdemo.zip

I'll do a sprite version in a bit.

The trick in PSP is to use a mask layer that fades from foreground to background. When you save image must select 'alpha channel transparency' from optimiser box, otherwise you only get 1 level.

Boo!
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 11th Mar 2004 20:39
Here you go:

save this image as small.png:



here's the code to bounce loads of sprites around screen:



Boo!
zircher
22
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 11th Mar 2004 23:00 Edited at: 11th Mar 2004 23:00
Quote: "The trick in PSP is to use a mask layer that fades from foreground to background. When you save image must select 'alpha channel transparency' from optimiser box, otherwise you only get 1 level."


Thanks, I've been thinking about a glowing sword effect, but I could not wrap my head around how to make the png file where it was 100% opaque at the blade edge but gradually faded away. Combine that with a scrolling texture and it should be a cool effect that doesn't require a ton of particles to do.
--
TAZ

Lampton Worm
22
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United Kingdom
Posted: 12th Mar 2004 10:53
Cool, thanks Spooky
Tapewormz
22
Years of Service
User Offline
Joined: 15th Sep 2002
Location: Winnipeg, Mantoba, Canada
Posted: 13th Mar 2004 06:12
I've found the following link to be a good source of information on creating alpha channels with photoshop for png. It's great if you own photoshop, I don't know if it ports well to different graphics packages.

I used this tutorial to create decals for mechwarrior 4. It shows how you can blend those images to remove hard (crunchy) edges when you layer your image over another. (example: a game score over your 3d game)

[href]http://www.ypoart.com/tutorials/ Alpha-about.htm[/href]

Login to post a reply

Server time is: 2025-06-30 07:21:12
Your offset time is: 2025-06-30 07:21:12