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

Author Topic: How to get cordinate of top left pixel in client area of RenderWindow?  (Read 2501 times)

0 Members and 1 Guest are viewing this topic.

pwnstar23

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • Email
I found that Mouse::getPosition() returns window space, you can subtract window.getPosition() but its off by the boarders of the window I think.  How to get this right?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: How to get cordinate of top left pixel in client area of RenderWindow?
« Reply #1 on: January 11, 2013, 08:47:20 am »
So you need Mouse::getPosition(window) (read the doc and tutorials please).
Laurent Gomila - SFML developer

pwnstar23

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • Email
Re: How to get cordinate of top left pixel in client area of RenderWindow?
« Reply #2 on: January 11, 2013, 08:53:57 am »
Yea thank you.  I was doing a search and found that.  Seems like it would be useful if you had a method on window class to get the client rect, for other programming problems. 

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: How to get cordinate of top left pixel in client area of RenderWindow?
« Reply #3 on: January 11, 2013, 09:09:16 am »
Quote
for other programming problems
Such as...?

The client rect is useful only if you have desktop coordinates. The only function that returns desktop coordinates is Mouse::getPosition(), and it already has an overload to get client coordinates. So I don't think that such a function would be useful at all.
Laurent Gomila - SFML developer

 

anything