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

Author Topic: How to change the point of origin?  (Read 3827 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: 11008
    • 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
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

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 »