Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chatbox cutting off bottom portion of words #25

Closed
Syntaf opened this issue Aug 9, 2014 · 3 comments
Closed

Chatbox cutting off bottom portion of words #25

Syntaf opened this issue Aug 9, 2014 · 3 comments

Comments

@Syntaf
Copy link

Syntaf commented Aug 9, 2014

I'm not sure weather this is an actual bug or not, but I can't seem to find any sort of solution to this problem so I'm coming here. That being said:

It seems no matter what I do, my console seems to cut off the lower part of words. The text is too far down in the chatbox and despite using all the available commands I can't correctly position the text to avoid being cut off. Here's a screenshot of the cut-off:

cutoff

the window is 400_w_ 200_h_, and the console is composed of an EditBox at the bottom and a ChatBox that will list commands.

in my Initialize function I set the properties of both to:

d_console_edit_box = tgui::EditBox::Ptr(gui);
d_console_edit_box->load("TGUI/widgets/black.conf");
d_console_edit_box->setSize(400,20);
d_console_edit_box->setPosition(0,180);
d_console_edit_box->setTextSize(12);
d_console_edit_box->setMaximumCharacters(32);
d_console_edit_box->setText("> ");

d_console_command_list = tgui::ChatBox::Ptr(gui);
d_console_command_list->load("TGUI/widgets/black.conf");
d_console_command_list->setSize(400,180);
d_console_command_list->setPosition(0,0);
d_console_command_list->removeScrollbar();
d_console_command_list->setLinesStartFromBottom(true);
d_console_command_list->setLineLimit(COMMAND_COUNT+1);
d_console_command_list->setTextSize(12);
d_console_command_list->setTextColor(d_console_edit_box->getTextColor());

I'm setting the size of the text the same in both these boxes, yet my Edit box doesn't do any sort of cutting off as my Chat box is doing. Is this a bug?

@texus
Copy link
Owner

texus commented Aug 9, 2014

I assume you are using SFML 2.1? The sf::Text::getLocalBounds returns a wrong value in that version which causes Label to clip incorrectly. And since ChatBox uses labels internally, it also gets affected.

So you should compile the github version of sfml (or use eXpl0it3r's nightly builds http://en.sfml-dev.org/forums/index.php?topic=9513.0). Just make sure to recompile TGUI with this new SFML version.

I'm really getting tired of these reports, I'm just going to put a big red warning on my download page now.

@texus texus closed this as completed in ad10b1b Aug 9, 2014
@texus
Copy link
Owner

texus commented Aug 9, 2014

I got a better idea, I just disabled clipping in Label. Nobody is going to use this in v0.6 anyway, and by the time v0.7 gets released there will already be an sfml 2.2.

So just download the latest tgui version and the problem should be solved. You don't have to change your sfml version anymore.

@Syntaf
Copy link
Author

Syntaf commented Aug 10, 2014

Thanks for the clarification!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants