SFML community forums

Help => Graphics => Topic started by: SuperV1234 on April 04, 2010, 09:46:13 pm

Title: .Center and .Scale
Post by: SuperV1234 on April 04, 2010, 09:46:13 pm
If I modify the .Scale of a Sprite, and then set the .Center to:
.Center = new Vector2(.Width / 2, .Height / 2);

...the center is not in the correct place. How do I prevent this?
Title: .Center and .Scale
Post by: Laurent on April 04, 2010, 11:23:33 pm
Center is in local coordinates, it is applied before all other transformations. This means that you don't have to change it when you apply a translation, rotation or scale.
Title: .Center and .Scale
Post by: SuperV1234 on April 05, 2010, 11:37:43 am
Quote from: "Laurent"
Center is in local coordinates, it is applied before all other transformations. This means that you don't have to change it when you apply a translation, rotation or scale.


Thanks, I understand now.