SFML community forums

Help => Graphics => Topic started by: Mr. X on October 02, 2008, 06:29:39 pm

Title: How to get the expected scale of an not drawn String
Post by: Mr. X 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?
Title: How to get the expected scale of an not drawn String
Post by: Laurent 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().
Title: How to get the expected scale of an not drawn String
Post by: Mr. X on October 02, 2008, 07:36:41 pm
Thank you,
it works.