Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: .Center and .Scale  (Read 2472 times)

0 Members and 1 Guest are viewing this topic.

SuperV1234

  • SFML Team
  • Full Member
  • *****
  • Posts: 188
    • View Profile
.Center and .Scale
« 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?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
.Center and .Scale
« Reply #1 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.
Laurent Gomila - SFML developer

SuperV1234

  • SFML Team
  • Full Member
  • *****
  • Posts: 188
    • View Profile
.Center and .Scale
« Reply #2 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.

 

anything