Gameboy Development Forum

Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)

You are not logged in.

#1 2019-06-04 08:13:35

coinfeeder
New member
Registered: 2019-06-04
Posts: 4

Loading fonts with a tile offset in GBDK

Hi there,

I'm currently porting a shmup I did for PICO8 to the Gameboy. All the main game logic is done and working great already, so I started work on the HUD.

Unfortunately I can't find a convenient way to load a font additionally to my existing background tiles. The default behaviour seems to be that loading fonts results into background tiles filled starting at position 0, so overwriting existing tiles. I know I could work around this by offseting my background tiles, but that's really inconvenient. And way to load fonts and make them not overwrite existing tiles, e.g. provide an offset? I couldn't find anything in the docs, but maybe somebody here figured it out in the past?

Thank you,

CF

Offline

 

#2 2019-06-06 11:24:58

bbbbbr
Member
Registered: 2019-03-04
Posts: 126

Re: Loading fonts with a tile offset in GBDK

You could try increasing the default value for "font_first_free_tile". I haven't tested that, but it looks like it specifies the tile where font loading starts.

Or, if you don't mind writing your own printing function (or modifying the GBDK one), you could use set_bkg_data() to load your font tiles and set the first_tile parameter to be something like (255 - (# of font tiles)) to locate them at the end of the background tile ram.

Last edited by bbbbbr (2019-06-06 11:25:33)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson