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

Author Topic: how does Transform::setOrigin works ?  (Read 1785 times)

0 Members and 1 Guest are viewing this topic.

Flaze07

  • Jr. Member
  • **
  • Posts: 64
    • View Profile
    • Email
how does Transform::setOrigin works ?
« on: July 09, 2017, 04:23:32 am »
hi...
for example i have this code
Code: [Select]
rect.setOrigin(rect.getSize().x / 2, rect.getSize().y / 2);
rect.rotate(1);
rect.setOrigin(0, 0);

the rect doesn't rotate according to the origin in the middle but according to the origin of top left
why ?

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: how does Transform::setOrigin works ?
« Reply #1 on: July 09, 2017, 04:43:28 am »
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Flaze07

  • Jr. Member
  • **
  • Posts: 64
    • View Profile
    • Email
Re: how does Transform::setOrigin works ?
« Reply #2 on: July 09, 2017, 05:32:10 am »
ah..I see  ;D