SFML community forums

Bindings - other languages => DotNet => Topic started by: zsbzsb on February 27, 2012, 02:09:55 am

Title: Quick Question - Text.GetRect
Post 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?
Title: Quick Question - Text.GetRect
Post by: texus on February 27, 2012, 04:05:02 pm
You can use Text.GetGlobalBounds() or Text.GetLocalBounds().
These functions return FloatRects which contains the Width and Height.
Title: Quick Question - Text.GetRect
Post by: Laurent on February 27, 2012, 04:15:01 pm
And please try to use meaningful titles for your posts ;)
Title: Quick Question - Text.GetRect
Post by: zsbzsb on February 27, 2012, 04:36:50 pm
Quote from: "texus"
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

Quote
And please try to use meaningful titles for your posts Wink

Sorry, I will change it.
Title: Quick Question - Text.GetRect
Post by: Laurent on February 27, 2012, 04:41:06 pm
You're not seeing it because it's private. I'll fix this as soon as possible :)
Title: Quick Question - Text.GetRect
Post by: zsbzsb on February 27, 2012, 04:42:17 pm
Quote from: "Laurent"
You're not seeing it because it's private. I'll fix this as soon as possible :)


Thank you Laurent  :D
Title: Quick Question - Text.GetRect
Post by: Laurent on February 27, 2012, 07:39:09 pm
It's fixed.
Title: Re: Quick Question - Text.GetRect
Post by: supdawg on December 02, 2012, 02:50:06 am
what is the difference between getGlobalBound and getLocalBound?
Title: AW: Re: Quick Question - Text.GetRect
Post by: eXpl0it3r on December 02, 2012, 07:24:31 am
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.