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

Author Topic: Check to show sprite function  (Read 6183 times)

0 Members and 1 Guest are viewing this topic.

Haze

  • Full Member
  • ***
  • Posts: 201
    • View Profile
    • Github Profile
Re: Check to show sprite function
« Reply #15 on: July 08, 2012, 02:06:10 am »
now my game is about 4000 by 2000, all I want to try and do is get the mouse coordinates not from the window itself but from its actually position in the game world, so if i moved right by 1000, the mouses position would be 2024. how can I achieve that?

If you've moved right by 1000px, I'm guessing you're using a view, so you add the view coordinates (+1000px) to the mouse cursor position.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10988
    • View Profile
    • development blog
    • Email
Re: Check to show sprite function
« Reply #16 on: July 09, 2012, 02:03:07 am »
Or better just use window.convertCoords(sf::Mouse::getPosition(window))...
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/