You are not logged in.
Hello,
Is it possible to use GRRLIB_PrintfTTF() with a variable string? Because it just works with a hard coded string.
Otherwise nothing will be displayd, not even other pictures and so...
I have this code:
char msg[] = "Some text!!!";
GRRLIB_DrawImg(0, 0, tex_background_png, 0, 1, 1, 0xFFFFFFFF);
GRRLIB_PrintfTTF((640-strlen(msg)*9)/2, 256, myFont, msg, 20, 0x00000000);
GRRLIB_Render();
.
.
.
But that doenst display anything...
It just works if its like this:
GRRLIB_DrawImg(0, 0, tex_background_png, 0, 1, 1, 0xFFFFFFFF);
GRRLIB_PrintfTTF((640-strlen("Some text")*9)/2, 256, myFont, "Some text", 20, 0x00000000);
GRRLIB_Render();
How can i solve this problem???
PS: Sorry for wrong title.
PS2: Problem solved. It doenst work if the string contains this sign "!" .
PS3: New problem. I need ! < > ...
Last edited by Double_A (2010-07-28 00:37:55)
Offline
I tried this code within the ttf demo:
char msg[] = "Some text!!!"; GRRLIB_PrintfTTF((640-strlen(msg)*9)/2, 256, myFont, msg, 20, 0xFFFFFFFF);
And it works fine. The only thing I did was to set the text color to 0xFFFFFFFF because the background was black.
Offline
The background image is white.
But that also crashes. Nothing is displayd when there is a special sign in the string.
And it works fine if there is just a string without special chars... So it cant be the color.
Is it maybe my font? FreeSerif and Gisha do not work.
What nice font do you recommend?
Last edited by Double_A (2010-07-28 00:46:22)
Offline
Try the font in the ttf examples folder. I know that one is working.
Offline
If you want to see the demo in action, you look at this video: http://www.youtube.com/watch?v=kvbS30xfqGQ
Or compile it yourself and sent it to the a Wii
Offline
! works now...
But < > äöü dont work...
äöü even cause some bad crash with a stack dump.
Offline
Instead of GRRLIB_PrintfTTF, try to use GRRLIB_PrintfTTFW. This function works exactly the same way but it uses wchar_t instead of char.
Offline