v0.7 alphav2 - text position on a button
« on: 02 October 2015, 02:08:47 »
Is it possible to set the position of the text on a button? I have the text size small and I wanted it to be in the top left corner of the button.

*

texus

  • *****
  • 1161
    • View Profile
    • Texus's Blog
Re: v0.7 alphav2 - text position on a button
« Reply #1 on: 02 October 2015, 09:56:32 »
No, this is not possible with just a Button.

You would have to use a button without text and use a Label which you position like this:
label->setPosition(tgui::bindPosition(button));

or if you want to fine-tune the distance to the top left corner a bit more:
label->setPosition(tgui::bindPosition(button) + sf::Vector(4, 2));

Re: v0.7 alphav2 - text position on a button
« Reply #2 on: 05 October 2015, 05:14:43 »
awesome - works a treat. Thank you.