You are not logged in.

  • Index
  •  » General Help
  •  » [RESOLVED] No images if draw and render outside from while(1)

#1 2010-07-27 23:56:33

Double_A
Member

[RESOLVED] No images if draw and render outside from while(1)

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

 

#2 2010-07-28 00:41:41

Crayon
Bad Mother Fucker

Re: [RESOLVED] No images if draw and render outside from while(1)

I tried this code within the ttf demo:

Code:

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

 

#3 2010-07-28 00:45:39

Double_A
Member

Re: [RESOLVED] No images if draw and render outside from while(1)

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

 

#4 2010-07-28 00:48:43

Crayon
Bad Mother Fucker

Re: [RESOLVED] No images if draw and render outside from while(1)

Try the font in the ttf examples folder. I know that one is working.

Offline

 

#5 2010-07-28 00:50:57

Crayon
Bad Mother Fucker

Re: [RESOLVED] No images if draw and render outside from while(1)

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 smile

Offline

 

#6 2010-07-28 00:57:14

Double_A
Member

Re: [RESOLVED] No images if draw and render outside from while(1)

! works now...
But < > äöü dont work...

äöü even cause some bad crash with a stack dump.

Offline

 

#7 2010-07-28 01:29:50

Crayon
Bad Mother Fucker

Re: [RESOLVED] No images if draw and render outside from while(1)

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

 
  • Index
  •  » General Help
  •  » [RESOLVED] No images if draw and render outside from while(1)

Board footer

Powered by FluxBB