#63722 - Liquid_Dark - Thu Dec 15, 2005 8:57 pm
When I use Ham's DrawText functions, I'm getting a messed up tile set.
My code is pretty simple:
IN GAME INITIALIZATION:
// load bg tiles
ham_SetBgMode(0);
ham_LoadBGPal((void *)bg_Palette, 16);
ham_bg[0].ti = ham_InitTileSet((void *)bg_Tiles, SIZEOF_16BIT(bg_Tiles), 1, 1);
ham_InitText(0);
//load map
ham_bg[0].mi = ham_InitMapEmptySet(3, 0);
map_fragment_info_ptr bgLevel = ham_InitMapFragment((void *)bg_Map, 30, 20, 0, 0, 30, 20, 0);
ham_InsertMapFragment(bgLevel, 0, 0, 0);
// display level
ham_InitBg(0, 1, 0, 0);
ham_SetBgXY(0, 0, 0);
IN GAME LOOP:
ham_DrawText(1,1,"Score: %d",score);
ham_DrawText(1,16,"High Score: %d",highscore);
What I get is not what I want:
[Images not permitted - Click here to view it]
Any idea how to fix this?
My code is pretty simple:
IN GAME INITIALIZATION:
// load bg tiles
ham_SetBgMode(0);
ham_LoadBGPal((void *)bg_Palette, 16);
ham_bg[0].ti = ham_InitTileSet((void *)bg_Tiles, SIZEOF_16BIT(bg_Tiles), 1, 1);
ham_InitText(0);
//load map
ham_bg[0].mi = ham_InitMapEmptySet(3, 0);
map_fragment_info_ptr bgLevel = ham_InitMapFragment((void *)bg_Map, 30, 20, 0, 0, 30, 20, 0);
ham_InsertMapFragment(bgLevel, 0, 0, 0);
// display level
ham_InitBg(0, 1, 0, 0);
ham_SetBgXY(0, 0, 0);
IN GAME LOOP:
ham_DrawText(1,1,"Score: %d",score);
ham_DrawText(1,16,"High Score: %d",highscore);
What I get is not what I want:
[Images not permitted - Click here to view it]
Any idea how to fix this?