String/letters label
« on: 12 March 2014, 17:10:22 »
Hello,
Why does label cut letters underline like in the picture in attachment? And how can I configure it to show string/letters properly?

Is it possible, and if it is, how to, place an url as a label? And how to place a picture as a button?

https://i.imgur.com/QMf91tu.jpg

*

texus

  • *****
  • 1161
    • View Profile
    • Texus's Blog
Re: String/letters label
« Reply #1 on: 12 March 2014, 17:44:51 »
Quote
Why does label cut letters underline like in the picture in attachment?
I've fixed this bug a couple of times, but it seems like it always comes back. Are you using TGUI v0.6.1 or the version from github? I actually can't reproduce it with either version.

Quote
And how to place a picture as a button?
Just use tgui::Picture::Ptr. You can also bind a click callback to it.

Quote
Is it possible, and if it is, how to, place an url as a label?
Do you just mean a clickable text? You can just let it send a callback when you click on the label and then handle the click yourself.
« Last Edit: 12 March 2014, 17:52:35 by texus »

Re: String/letters label
« Reply #2 on: 15 March 2014, 12:54:48 »
Thank you it worked.

Re: String/letters label
« Reply #3 on: 17 March 2014, 15:19:39 »
0.6.2 label/string letters are being cut again.

*

texus

  • *****
  • 1161
    • View Profile
    • Texus's Blog
Re: String/letters label
« Reply #4 on: 17 March 2014, 16:58:59 »
I don't even think anything changed in Label between v0.6.1 and v0.6.2.

I can't reproduce it (on linux). Could you show some small program for which it doesn't work for you?

Re: String/letters label
« Reply #5 on: 17 March 2014, 18:40:13 »
we are working on same project, labels are cut on my linux. Here is code for labels:

Code: [Select]
    tgui::Label::Ptr labelPlayerSettings(*settingsScreen);
    labelPlayerSettings->setText("Music Player:");
    labelPlayerSettings->setTextColor(sf::Color::White);
    labelPlayerSettings->setPosition(430, 20);
    labelPlayerSettings->setTextSize(20);

    tgui::Label::Ptr labelRandomSongs(*settingsScreen);
    labelRandomSongs->setText("Play random songs");
    labelRandomSongs->setTextColor(sf::Color::White);
    labelRandomSongs->setPosition(460, 60);
    labelRandomSongs->setTextSize(10);

And other code from picture below. Labels are cut on bottom.
using Linux: Elementary OS Luna.
TGUI: 0.6.2 just downloaded tham and installed
SFML: 2.1

picture: https://s18.postimg.org/8jts76j4p/cut_Label.png

EIDT: If needed i can make new project with just labels

*

texus

  • *****
  • 1161
    • View Profile
    • Texus's Blog
Re: String/letters label
« Reply #6 on: 17 March 2014, 18:54:50 »
I can reproduce the problem with SFML 2.1, but not with the github version.

Something must have changed in sf::Text since sfml 2.1 I guess, because sfml 2.1 seems to mess up the clipping calculations in TGUI.

Edit: according to this commit, the problem was introduced in sfml 2.1, and fixed afterwards.
« Last Edit: 17 March 2014, 18:58:43 by texus »

Re: String/letters label
« Reply #7 on: 17 March 2014, 19:01:31 »
Downloading guthub version, will report back after i install and test. thank you

EDIT: It works perfectly with current github version of SFML. Thank you
« Last Edit: 17 March 2014, 19:22:42 by wmbuRn »