Q: Overlaying keyboard on background
Posted: Thu Apr 16, 2009 11:14 am
HI I've been trying to display the keyboard over a bitmap background. I got the background but the graphics for the keyboard is garbled. Any pointers appreciated. Thanks
Here is the code
videoSetMode(MODE_5_2D);
vramSetMainBanks(VRAM_A_MAIN_BG_0x06000000, VRAM_B_MAIN_BG_0x06020000, VRAM_C_SUB_BG, VRAM_D_LCD);
consoleDemoInit();
bg = bgInit(3, BgType_Bmp16, BgSize_B16_256x256, 0, 0);
buffer = (u16*)bgGetGfxPtr(bg);
//Create the keyboard
keyboard = keyboardInit(NULL, 2, BgType_Bmp16, BgSize_B8_512x256, 20, 0, true, true);
//Load the background on buffer
...
lcdMainOnBottom();
while (1) {
key = keysDown();
if ((key & KEY_A) {
if (keyboardDisplay->visible)
keyboardHide();
else
keyboardShow();
}
}
Here is the code
videoSetMode(MODE_5_2D);
vramSetMainBanks(VRAM_A_MAIN_BG_0x06000000, VRAM_B_MAIN_BG_0x06020000, VRAM_C_SUB_BG, VRAM_D_LCD);
consoleDemoInit();
bg = bgInit(3, BgType_Bmp16, BgSize_B16_256x256, 0, 0);
buffer = (u16*)bgGetGfxPtr(bg);
//Create the keyboard
keyboard = keyboardInit(NULL, 2, BgType_Bmp16, BgSize_B8_512x256, 20, 0, true, true);
//Load the background on buffer
...
lcdMainOnBottom();
while (1) {
key = keysDown();
if ((key & KEY_A) {
if (keyboardDisplay->visible)
keyboardHide();
else
keyboardShow();
}
}