Introduction

Day 1
GBA Hardware

Day 2
"Hello, World!"

Day 3
Input

Day 4
Backgrounds -
  Bitmapped Modes

Day 5
Sprites

Day 6
Backgrounds -
  Tile Modes

Day 7
Project 1 -
  Tetris

Quiz - Week 1

Day 8
Sprites #2 -
  Animation

Day 9
Maps

Day 10
Sprites #3 -
  Animation #2

Day 11
Backgrounds -
  Rotation

Day 12
Sprites #4 -
  Mosaic

Version History

Downloads

Books

Links

Graphics FAQ

GFX2GBA Readme

Games

Projects

Credits

Support

HAM Tutorial :: Graphics FAQ

 

General Questions
Photoshop Questions
GIMP Questions

 

General Questions

Question: I get the following when compiling my program. Why?
warning: `background_Palette' initialized and declared `extern'

Answer: The version of gfx2gba that came with HAM 2.50 (version 0.13)
added extern to the beggining of the array name. This will be changed in
version 0.14. You can ignore the error or remove extern from the begging
of each of your .c graphic files.

 


 

NOTE: A common problem people have is creating a bitmap with an 8-bit palette. When I first started GBA programming, I had no idea how to do it. Honestly, I am not a graphics expert, as you can tell by my backgrounds and sprites I've created for my tutorials, but I will try to give you an idea of where to start with what I've found to be common problems.

Photoshop 6.0 - Windows

Currently I do almost everything in Photoshop, so let's start there.

HOWTO: Setup Your Image For gfx2gba

Start by creating a new image. You can begin with the Mode set to RGB. Draw the image and then save it as a standard PSD file. The next part is important, so pay attention.

Click Image -> Mode -> Indexed Color
Under Palette, choose either Exact or Local (Perceptive)
  If you pick Local (Perspective you need to do the following as well
  - Set the Colors to 256
  - Set Forced to None
Click OK
Click File -> Save As
Next to Format, choose BMP
Under File Format, Windows should be selected
Under Depth, 8 bit should be selected
Click OK

That's it. It's pretty simple to get the basic palette setup.

HOWTO: Work With You Palette / Color Index

This is how you determine the index number of a color in your palette or add new ones to it for use with ham_SetTextCol(), etc.

Your image should be set to Indexed Color. If not, take a look at the the HOWTO for setting up image and do that first.

Click Window -> Show Info
  NOTE: If you only see Hide Info, then the info window is already there
Click Image -> Mode -> Color Table

Now, as you move your cursor over the colors, you'll see the index of the color show up in the Info window next to Idx:. Easy, huh?!

One more thing... If you want to add colors to your index, just click on the first empty spot in the palette. Empty colors should be black and near the end of the chart.

 


 

Gimp 1.2.4 - Windows

What the heck is Gimp? Gimp is a Unix program similar to Photoshop which has been ported to Windows. It is free, works very well and there are tons of free plugins, too. If you don't already have Photoshop, I recommend you give it a try. The actual homepage is here, but you can find the Windows port here. The installer version is here.

HOWTO: Setup Your Image For gfx2gba

Click File -> New (Set width & height, everything else default)
Click OK
Right-click on the image & choose Image -> Mode -> Indexed...
Generate Optimal Palette should be selected.
# of Colors should be 256 (or 16 if you are doing a 16 bit palette)
Click OK

That's all there is to it. Another easy one!

HOWTO: Work With You Palette / Color Index

Click File -> Dialogs -> Indexed Palette
The Indexed Color Palette should pop up and you'll see the all of the colors in your palette. Click on the color, who's index you want to know, and it will appear in the Index window.

 

 

 

 

 

 

<<

HOME

>>