SFML community forums
Bindings - other languages => DotNet => Topic started by: zsbzsb on February 27, 2012, 02:09:55 am
-
Just started updating my code to the newly released .Net bindings and I ran into a small issue. Before in my code I would use Text.GetRect() to center the text. Now I am looking around and I don't see anything to replace it. So my question is, is there anyway to get the Rect of a Text? Maybe possibly using the Text.Origin?
-
You can use Text.GetGlobalBounds() or Text.GetLocalBounds().
These functions return FloatRects which contains the Width and Height.
-
And please try to use meaningful titles for your posts ;)
-
You can use Text.GetGlobalBounds() or Text.GetLocalBounds().
These functions return FloatRects which contains the Width and Height.
Ok, So I am using the latest bindings for .Net and these appear to be missing. Is this a bug or am I just not seeing it?
http://imageshack.us/photo/my-images/254/missinggetbounds.jpg
And please try to use meaningful titles for your posts Wink
Sorry, I will change it.
-
You're not seeing it because it's private. I'll fix this as soon as possible :)
-
You're not seeing it because it's private. I'll fix this as soon as possible :)
Thank you Laurent :D
-
It's fixed.
-
what is the difference between getGlobalBound and getLocalBound?
-
what is the difference between getGlobalBound and getLocalBound?
GlobalBounds will return the axis aligned bounding box, that is it has all the scaling and rotating taken into account, where as LocalBounds simply retirn the original width and height.