Garbled text in textbox and window caption


29-03-2014 21:24:52

Hey all,
When I try to display text, my text is always garbled. I'm not sure what I'm doing wrong, so I figured I'd ask for advice. Please see a screenshot of the garbled text I'm referring to.

I've tried a variety of different things. But the basic jist of the code I'm using is the following:

MyGUI::Window* window = static_cast<MyGUI::Window*>( static_cast<MenuItemComponent*>(*parentIter)->GetWidget() );
MyGUI::TextBox* t = window->createWidget<MyGUI::TextBox>( "TextBox", MyGUI::IntCoord( 0, 0, 50, 50 ), MyGUI::Align::Left, "Main" );
t->setCaption( "Test" );

Looking in the mygui log file I see no errors at all. Has anyone else seen this? And if so, what did you do to resolve this?

- goishin


29-03-2014 21:45:16

Hi, I never heard about such problem.
The only guess I have right now is that Freetype generated invalid texture.

Does MyGUI demos work fine or have same problem?


29-03-2014 22:12:46

Yeah, everything else works great. I've even been using mygui in this project. And I've ripped out mygui and redone it about three times so far. But this time around, I ripped everything out, and now I just can't get the text to work right.


05-04-2014 21:06:38


I'm still working on the problem, but am running out of ideas. Any suggestions? I'm desperate and am willing to try anything.


06-04-2014 22:36:05

Try removing objects from scene. There is a chance, that some material in not fully resetted in render manager, so part of it affect MyGUI's material.
Try removing various blocks of code to see which one might cause problem.


07-04-2014 18:07:49

I figured it out!

I'm using the sample BaseApplication that comes with Ogre as my base that I'm building on top of. It's small and simple and just enough to get me going. However, there's a few things the base application does that I've since started handling in my own code. In this case, it's input. I do it all myself, but I still pipe input events to the base class. And for some reason, I had decided to do level-loading using the F5 key, which then gets piped to the base application, which also has a binding for the F5 key, which happens to reload all textures. I figured out what was happening through trial and error. I started removing things to the point where I had realized that I had actually removed all of my own input handling, and the problem was still occurring. I thought, "how can that be" and then realized that keyboard input was still being piped to the base application. I poked in there, and saw that F5 that made the following call:
Anyway, for some reason, calling that function will garble your text.


08-04-2014 03:12:30

Glad you figured it out.
I'll check what's wrong with texture and why it gets broken after reload.


08-04-2014 18:30:41


Let me know if I can help, Altren. I've got some good repro steps if you need 'em.