gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Graphics > PCX2PNG transparency?

#97315 - lostgame - Wed Aug 09, 2006 4:29 am

I am a real newbie to the whole GBA development thing, but I managed to make a demo of a little circle that you can move around the screen with the d-pad, and I made a background of a gradient, and I used the generic "gba_types", "gba_keys", "gba_sprites", "gba", etc, header files that a lot of homebrew open source games use.

I added one sprite, it's a PCX file of a little blue circle. The edges are black right now (0,0,0 RGB) and I want to make the edges around the circle transparent.

How do I go about doing this? Again, I'm sorry if this is an old question, and it's a very n00bish thing to ask, but I'm new to all this, and I'd like to get back into it, thanks in advance guys!

-Nic

EDIT: Is GIMP fine? I don't want to buy Photoshop...

#97333 - keldon - Wed Aug 09, 2006 8:12 am

Gimp is fine, I don't think photoshop is for this. Fireworks also works good, but gimp is free and does it fine.

Basically you need to set your transparent colour as the first colour in the index. Magenta is the least popular colour so that is usually the choice for colour 0, you basically want it to be the colour that is least present in your image.

#97399 - thegamefreak0134 - Wed Aug 09, 2006 4:08 pm

In GBA programming, you'll find that you need a good image editor to handle palettes. You need to have complete controll over the palette of every image, because basically that's the only way to set transparency at all. I find Usenti yo be a very nice tool, as it allows you to import a lot of different types and has lots of MSPaint like features.

While I'm on the subject, please do not use MSPaint for this programming. No really, please. It could care less about the palette and changes it around at it's own whim.

</rambling>

The first color of the palette is the transparent one. This is a GBA hardware thing and actually to my knowledge cannot be changed. If you are in 256 color mode, it's only color 0 for the whole pallete. If you're in 16 color mode, it's the first color of every 16 color sub-set.

Usenti is written by Cearn by the way, and I believe can be found at TONC.

-gamefreak
_________________
What if the hokey-pokey really is what it's all about?

[url=http:/www.darknovagames.com/index.php?action=recruit&clanid=1]Support Zeta on DarkNova![/url]