Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
Window
»
How to get cordinate of top left pixel in client area of RenderWindow?
Print
Pages: [
1
]
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
How to get cordinate of top left pixel in client area of RenderWindow?
«
on:
January 11, 2013, 08:41:11 am »
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?
Logged
Laurent
Administrator
Hero Member
Posts: 32498
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).
Logged
Laurent Gomila - SFML developer
pwnstar23
Newbie
Posts: 16
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.
Logged
Laurent
Administrator
Hero Member
Posts: 32498
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.
Logged
Laurent Gomila - SFML developer
Print
Pages: [
1
]
SFML community forums
»
Help
»
Window
»
How to get cordinate of top left pixel in client area of RenderWindow?
anything