#55865 - GrenadeJumper - Mon Oct 03, 2005 3:48 pm
Hi All,
I'm using the framebuffer mode to create a simple interface on the touchscreen (Img 1: [Images not permitted - Click here to view it]). This is done by creating shapes and layering them (e.g. make big blue shape, then make smaller black shape on-top of that, then smaller blue shape on top of that).
Then i use the subpixel font over everything to add text. But it just won't work! (Img 2: [Images not permitted - Click here to view it] (Mockup)).
Here's an extract from my code:
The really annoying thing is, it doesn't matter where the "1." print line goes! It can be first, last, or in the middle, and it won't show up!
Once again, I hope it's something rediculously silly...
_________________
H/W: European NTR-001 - natrium42 PassMe v1.4 - Extreme Flash Advance 256Mb
S/W: EFA-Linker 2.5 - PA_Lib - Programmer's Notepad 2
I'm using the framebuffer mode to create a simple interface on the touchscreen (Img 1: [Images not permitted - Click here to view it]). This is done by creating shapes and layering them (e.g. make big blue shape, then make smaller black shape on-top of that, then smaller blue shape on top of that).
Then i use the subpixel font over everything to add text. But it just won't work! (Img 2: [Images not permitted - Click here to view it] (Mockup)).
Here's an extract from my code:
Code: |
void drawText()
{ touchPosition touchXY = touchReadXY(); char text1[14] = "Touch x = "; // touchXY.px char text2[14] = "Touch y = "; // touchXY.py int num1 = touchXY.px; char buf1[10]; int num2 = touchXY.px; char buf2[10]; itoa(num1, buf1, 20); itoa(num2, buf2, 20); subPixelPutString(0, 0, text1); subPixelPutString(0, 9, text2); subPixelPutString(30, 0, buf1); subPixelPutString(30, 9, buf2); subPixelPutString(116, 16, "1."); subPixelPutString(116, 46, "2."); subPixelPutString(116, 76, "3."); subPixelPutString(116, 106, "4."); subPixelPutString(116, 136, "5."); subPixelPutString(116, 166, "6."); } void draw_buttons(int sel) { uint16 newy = 10; int counter = 1; char buf2[4]; itoa(sel, buf2, 20); subPixelPutString(0, 18, buf2); while(newy < 170) { draw_customshape(110, newy, 90, 20, VRAM_A, RGB15(3,3,15)); draw_customshape(113, newy+3, 84, 14, VRAM_A, RGB15(0,0,0)); draw_customshape(114, newy+4, 10, 12, VRAM_A, RGB15(3,3,15)); draw_customshape(125, newy+4, 71, 12, VRAM_A, RGB15(3,3,15)); if(counter == sel) { draw_customshape(210, newy, 30, 20, VRAM_A, RGB15(1,1,8)); draw_customshape(211, newy+1, 29, 19, VRAM_A, RGB15(6,6,25)); draw_customshape(211, newy+1, 28, 18, VRAM_A, RGB15(3,3,15)); draw_customshape(213, newy+3, 24, 14, VRAM_A, RGB15(31,31,31)); } else { draw_customshape(210, newy, 30, 20, VRAM_A, RGB15(6,6,25)); draw_customshape(211, newy+1, 29, 19, VRAM_A, RGB15(1,1,8)); draw_customshape(211, newy+1, 28, 18, VRAM_A, RGB15(3,3,15)); draw_customshape(213, newy+3, 24, 14, VRAM_A, RGB15(0,0,0)); } draw_customshape(214, newy+4, 22, 12, VRAM_A, RGB15(3,3,15)); newy += 30; counter++; } drawText(); } |
The really annoying thing is, it doesn't matter where the "1." print line goes! It can be first, last, or in the middle, and it won't show up!
Once again, I hope it's something rediculously silly...
_________________
H/W: European NTR-001 - natrium42 PassMe v1.4 - Extreme Flash Advance 256Mb
S/W: EFA-Linker 2.5 - PA_Lib - Programmer's Notepad 2