String/letters label

Started by ColaGGS, 12 March 2014, 17:10:22

ColaGGS

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

#1
QuoteWhy 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.

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

QuoteIs 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.

ColaGGS


ColaGGS

0.6.2 label/string letters are being cut again.

texus

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?

wmbuRn

we are working on same project, labels are cut on my linux. Here is code for labels:


    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

#6
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.

wmbuRn

#7
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