Computer Webmaster Gaming Console Graphics Forum

Welcome to the Computer Webmaster Gaming Console Graphics Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

MK PitStop Main Earn $25 Earn Money Posting Extras Members Blogs Image Hosting User Pages
Go Back   Computer Webmaster Gaming Console Graphics Forum > Computer Forums > Software Programming
Register FAQ/Rules Become A V.I.P. Member Search Today's Posts Mark Forums Read

Software Programming Software programming talk, ask questions about computer software programming or help others

Google
Closed Thread
 
LinkBack Thread Tools Display Modes
Old 06-12-2007, 9:44 PM   #1
Frank Hoffmann
 
Frank Hoffmann's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default SDL, using PNG files with alpha transparency...

Hi,

I'm going to program a simple 2D platform independent game using SDL.
My development environment is Win32 (XP) with MS VC++ .NET.

All sprites uses 32bit depth and will be stored in a format which supports alpha channels.
Instead of color keying I want to use real transparency, using the alpha channel of the sprite.

Does anybody know how to use PNG/PSD files with SDL ?



TIA,

Frank
--
ats uxThemePatcher XP .NET

© 2003 by animalTactics
http://kickme.to/ats
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Advertisements
Old 06-12-2007, 9:44 PM   #2
gappy
 
gappy's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default SDL, using PNG files with alpha transparency...

Don't know about the SDL but the standard (pretty standard) format for
sprites with alpha channels is BMP


"Frank Hoffmann" <atomicStrike@gmx.de> wrote in message
news:bhg4c1$c1ds$1@ID-77060.news.uni-berlin.de...
Hi,

I'm going to program a simple 2D platform independent game using SDL.
My development environment is Win32 (XP) with MS VC++ .NET.

All sprites uses 32bit depth and will be stored in a format which supports
alpha channels.
Instead of color keying I want to use real transparency, using the alpha
channel of the sprite.

Does anybody know how to use PNG/PSD files with SDL ?



TIA,

Frank
--
ats uxThemePatcher XP .NET

© 2003 by animalTactics
http://kickme.to/ats


 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Old 06-12-2007, 9:44 PM   #3
Tony Di Croce
 
Tony Di Croce's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default SDL, using PNG files with alpha transparency...

You'll be very impressed with SDL .PNG alpha support, if you can get you're
paint software to do what you want.

First of all, I use PSP (7 or 8) and these instructions will apply to this
package only (and to SDL).

In PSP, choose File->Export->PNG Optimizer, then click the tranparency tab.
Set it to "Alpha channel transparency".
Click OK, then name the file.

Now, if you're art has a proper transparent background (in PSP transparency
looks like a checkerboard, I think in photoshop it looks like a crosshatch
pattern?), all you need to do is load the png via the normal sdl_img
functions. SDL is smart enough to set the color key for a new surface if the
..PNG you're loading from has the color key field (in it's header) set, and
the above instructions guarantee that PSP saved the file with this info.

Here's the best part!

SDL will also, automatically use whatever alpha channel is available in the
source image when blitting! This was a real pleasant surprise when I found
it out on my last game... I was building some lazy clouds that floated above
the player... I was fooling with transparency and I accidently export'ed the
png with about 50% alpha transparency. This built in support for alpha
blending let me implement the coolest effects in my game...

Tony


"Frank Hoffmann" <atomicStrike@gmx.de> wrote in message
news:bhg4c1$c1ds$1@ID-77060.news.uni-berlin.de...
Hi,

I'm going to program a simple 2D platform independent game using SDL.
My development environment is Win32 (XP) with MS VC++ .NET.

All sprites uses 32bit depth and will be stored in a format which supports
alpha channels.
Instead of color keying I want to use real transparency, using the alpha
channel of the sprite.

Does anybody know how to use PNG/PSD files with SDL ?



TIA,

Frank
--
ats uxThemePatcher XP .NET

© 2003 by animalTactics
http://kickme.to/ats


 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Old 06-12-2007, 9:44 PM   #4
Frank Hoffmann
 
Frank Hoffmann's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default SDL, using PNG files with alpha transparency...

Hi,

thanks for all answers.
I want to recommend this library for SDL:

http://www.libsdl.org/projects/SDL_image/

As Tony mentioned, using .png with alpha channels allows you to implement
fantastic effects in your game. Maybe I will use this for a particle generator,
or lightning effects...

Frank
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Featured Websites
Free Space
Free Space
Free Space Free Space
Closed Thread
Tags: , , , , ,




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
New question for an old problem, Transparency TooSano Graphics in general 2 06-11-2007 11:44 PM
transparency Butch Cassidy Graphics in general 4 06-11-2007 11:05 PM
Question about erasing to transparency . . . Stan Shankman Graphics in general 2 06-11-2007 10:29 PM
Transparency Gone When Placing into InDesign Leonardo Graphics in general 3 06-11-2007 9:45 PM
Question about transparency between photoshop and illustrator... oGhr Graphics in general 0 06-11-2007 9:43 PM


Featured Websites




All times are GMT +1. The time now is 12:28 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.0.0
Cheap Computers
MK PitStop Copyright 2005 - 2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98