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

Author Topic: How to change the point of origin?  (Read 285 times)

0 Members and 1 Guest are viewing this topic.

mrjbom

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
How to change the point of origin?
« on: January 31, 2019, 03:11:43 pm »
Hello.
By default, the position of the object is from the top left corner of the window, I need to set this point in the middle of the bottom of the window. So that it looks like this picture.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 9239
    • View Profile
    • development blog
    • Email
Re: How to change the point of origin?
« Reply #1 on: January 31, 2019, 03:57:11 pm »
You can move the origin point by moving the sf::View.
You can't change the axis direction, but you can simply negate the value before you set the position.
Official FAQ: https://www.sfml-dev.org/faq.php
Nightly Builds: https://www.nightlybuilds.ch/
——————————————————————
Dev Blog: https://dev.my-gate.net/
Thor: http://www.bromeon.ch/libraries/thor/

mrjbom

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: How to change the point of origin?
« Reply #2 on: January 31, 2019, 04:51:39 pm »
You can move the origin point by moving the sf::View.
You can't change the axis direction, but you can simply negate the value before you set the position.

Thanks you.
« Last Edit: January 31, 2019, 09:29:53 pm by mrjbom »