Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - HYXYH

#1
Help requests / label text looks compressed
22 September 2016, 17:26:26
I try to create sf::Text and tgui::Label with same font and character size, but they actually have different character size, tgui::Label looks compressed. What I made wrong?

Code (cpp) Select

// sf::Text justText;
justText.setString("sf::Text HELLO");
justText.setFont(font);
justText.setCharacterSize(18);
justText.setStyle(sf::Text::Style::Regular);
justText.setPosition(50, Game::windowHeight/2);

tgui::Label::Ptr label = theme->load("label");
label->setText(" tgui::Label HELLO");
label->setFont(font);
label->setTextSize(18);
label->setPosition(((justText.getGlobalBounds().width + 50) / Game::windowWidth) * 1000 + 3, 510);
Game::gui.add(label);