Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: How to get the expected scale of an not drawn String  (Read 2535 times)

0 Members and 1 Guest are viewing this topic.

Mr. X

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
How to get the expected scale of an not drawn String
« on: October 02, 2008, 06:29:39 pm »
Hello,
I'm trying to write a GUI for my program. For displaying an well looking Button I want to write the Text in the middle of the Rectangle around it. For my algorithm I need to find out the expected X-Scale of the String, which isn't drawn at this moment.

Is there a way to find out?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
How to get the expected scale of an not drawn String
« Reply #1 on: October 02, 2008, 07:34:45 pm »
What is the "X-Scale" for you ? If you're talking about the string width, its str.GetRect().GetWidth().
Laurent Gomila - SFML developer

Mr. X

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
How to get the expected scale of an not drawn String
« Reply #2 on: October 02, 2008, 07:36:41 pm »
Thank you,
it works.