SFML community forums

Bindings - other languages => DotNet => Topic started by: MarekkPie on January 22, 2012, 07:49:09 am

Title: Drawable Center not updating with movement
Post by: MarekkPie on January 22, 2012, 07:49:09 am
I don't know if this is intentional or not (but I doubt it is), but when you update the position of a Drawable, the rest of the position relative variables (specifically Center) do not update accordingly. It seems in the C++ documentation that there is a Move method that may do this part for you, but at least in SFML.NET 1.6 it doesn't seem to exist.
Title: Drawable Center not updating with movement
Post by: Nexus on January 22, 2012, 10:59:17 am
This is intentional, position and center are independent attributes.

The position is the translation relative to the global coordinate system (left-upper window corner in default view), the center the translation relative to the local coordinate system (the sprite's left-upper corner).
Title: Drawable Center not updating with movement
Post by: MarekkPie on January 22, 2012, 05:11:13 pm
Interesting, and a bit confusing for a reader. I get what you mean, but "center" doesn't really equate to "upper-left" to me. A center isn't a arbitrary location, it's the center of the object. I would have thought "origin" would be more appropriate, since you are probably using that point the manipulate the image in its local space or rotate the image around that point. Maybe it's just a translation thing.
Title: Drawable Center not updating with movement
Post by: Laurent on January 22, 2012, 05:19:54 pm
Quote
I would have thought "origin" would be more appropriate

Guess what... it's named "origin" in SFML 2 ;)
Title: Drawable Center not updating with movement
Post by: MarekkPie on January 22, 2012, 05:21:14 pm
Sweet.