GP32 Gptextout Question


Pirotic

Certified Guru
Joined
Feb 16, 2004
Messages
593
Hiya, im currently coding a word-wrapping function to make dialogs alot easier to manage.

Code:
	GpTextOut(NULL, &LCDbuffer[nflip], x, y, (char*)virtual_keyboard_input[i], 0x07);

Basically, i have virtual_keyboard_input which is a CHAR array (something like 350 big)

And all i want to do is show one of the characters in the char array,

so for instance, lets assume the 5th letter is A

(virtual_keyboard_input[4] = 'A';)

i just want GpTextOut to show that one character, but when i throw the char array at it and specify which array i want it to read it just refuses and draws the whole bloody thing every time.

anybody know a way of doing this? im sure its simple but being pretty new to C i dont know where im going wrong :D

regards
 
I don't know whats wrong, but when I programmed a function to draw text on a MCS51 controller it also didn't work fine.
So I used sprintf() to format the char/int/what ever to a string.
 
GpTextOut() prints a zero ended string.
What you want to print is a char.
Declare a char array of length 2.
Put your char in the first position and the '\0' character in the second.
Call GpTextOut() with this array.

Did you know that my OKF Font Engine already does that for you and a lot of other things?
You should really check it.
 
Oankali posted on May 27 2004 at 08:06 AM said:
GpTextOut() prints a zero ended string.
What you want to print is a char.
Declare a char array of length 2.
Put your char in the first position and the '\0' character in the second.
Call GpTextOut() with this array.

Did you know that my OKF Font Engine already does that for you and a lot of other things?
You should really check it.
you sir, have just solved my problem.

cheers mate, worked a treat - i'll look at your source if i have any more problems with sdk font functions.
 
Last edited by a moderator:
Back
Top