I have already created a forum for MIDletPascal in Compilers and IDE via the Administration Panel, but it appears that WILL needs to do some kind of incantation and or dance before it will appear for all to see. So it does exist ( you'll need to trust me ), but only I can see it until WILL gets back, which I think is this week-end.
On another note, I'm finding the DrawText function unreliable as you can never guarantee that the default font size it chooses is small enough of big enough to work on all mobiles. To avoid this I'd like to use bitmap fonts where each letter is either 8x8 or 12x12. At least then I know how to space all my text.
I've managed to write a function to display numbers ( see below ), but could not find an easy way via the MIDP API to get the alphabet happening. I've probably overlooked something. Any ideas?
My number sprite routine is...
[pascal]procedure DrawSpriteText( Text: string; x, y: integer );
begin
for iCounterX := 0 to Length( Text ) - 1 do
begin
DrawImage( NumberSprites[ StringToInteger( GetChar( Text, iCounterX ) ) ], x, y );
x := x + 8;
end;
end;
[/pascal]
iCounter is a global counter variable used in all my loops.
and since this font is 8x8 that is why x := x + 8; is used to draw the next number in the string.
Bookmarks