I'm working on a little port of Snake to the MD in order to improve my knowledge of SGDK but i've got a little question
How would i be able to change the font used when drawing text?
Also, are there any size restrictions to be aware of when creating fonts?
This is the little intro screen where i want to change the font.
The Snake is probably not supposed to look that evil... but... it's a snake goddamit!!
SGDK Noob Question
Moderator: Stef
SGDK Noob Question
"I'm looking for some alien toilet to park my bricks, who's first?"
if you want to use the VDP_drawText then each character must use only one tile or 8x8 pixels (it can be smaller but you have to center it and make it 8x8) and then you just load the tiles were the old font was.
If you want to use a font bigger than 8x8 then you would have to write your own code
If you just want the font changed for the title screen then you can just make a fancy font in photoshop or whatever just make a 320x224 image
look at this game I programed in sgdk it says it was a sonic hack but it relay was a rick roll (I was testing my fmv player which is also written in c using sgdk)
http://www.youtube.com/watch?v=fNjJu0FjP84
If you want to use a font bigger than 8x8 then you would have to write your own code
If you just want the font changed for the title screen then you can just make a fancy font in photoshop or whatever just make a 320x224 image
look at this game I programed in sgdk it says it was a sonic hack but it relay was a rick roll (I was testing my fmv player which is also written in c using sgdk)
http://www.youtube.com/watch?v=fNjJu0FjP84
Hi,
i've ripped original font included in SGDK.
http://www.toofiles.com/fr/oip/documents/bmp/font.html
Modify this image, replace the letters by yours (it's possible to find nice font on the web)
Be sure your font is 8*8 pixels!
Then convert your image with genitile (for example)
Call it with :
Then you could be able to draw text with your new font simply by using VDP_drawText function.
When replacing color, be carreful. I'm working with photsop and i used color 15 and 14 to make a 2-colors font.
When working with photoshop, if using color 1 (check the palette) will result VDP_drawText command line will use color 1 of the textpalette.
I d'ont know if i'm very clear, but if i can help
i've ripped original font included in SGDK.
http://www.toofiles.com/fr/oip/documents/bmp/font.html
Modify this image, replace the letters by yours (it's possible to find nice font on the web)
Be sure your font is 8*8 pixels!
Then convert your image with genitile (for example)
Call it with :
Code: Select all
VDP_doVRamDMA((u32) font_tiles, 41984, 3072);
When replacing color, be carreful. I'm working with photsop and i used color 15 and 14 to make a 2-colors font.
When working with photoshop, if using color 1 (check the palette) will result VDP_drawText command line will use color 1 of the textpalette.
I d'ont know if i'm very clear, but if i can help
-
- Very interested
- Posts: 117
- Joined: Sun Jan 02, 2011 9:14 pm
- Contact:
Load that bmp provided by oofwill in a .rc file as BITMAP and write some code like
extern const u32 *my_font;
VDP_loadFont ( my_font, 1 );
The result -->http://twitpic.com/8p3ikk
extern const u32 *my_font;
VDP_loadFont ( my_font, 1 );
The result -->http://twitpic.com/8p3ikk