Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
Graphics
»
Are there any function that could change the coordinates system of window ?
Print
Pages: [
1
]
Author
Topic: Are there any function that could change the coordinates system of window ? (Read 2488 times)
0 Members and 1 Guest are viewing this topic.
lyvinhloi.cntt
Newbie
Posts: 10
Are there any function that could change the coordinates system of window ?
«
on:
June 07, 2014, 07:00:43 pm »
Oh .. uhm ...
I want to change the coordinates system of window from the top-left to the bottom-left to easy to draw my sprites.
Logged
Ixrec
Hero Member
Posts: 1241
Re: Are there any function that could change the coordinates system of window ?
«
Reply #1 on:
June 07, 2014, 07:28:25 pm »
No, although you could use the setOrigin() function on every single one of your Transformables to get the same effect. Having the origin in the top-left corner is a common convention in computer graphics, so it's best to just get used to it.
«
Last Edit: June 07, 2014, 07:30:41 pm by Ixrec
»
Logged
lyvinhloi.cntt
Newbie
Posts: 10
Re: Are there any function that could change the coordinates system of window ?
«
Reply #2 on:
June 07, 2014, 07:43:57 pm »
Thanks for the answer
..
Logged
FRex
Hero Member
Posts: 1848
Back to C++ gamedev with SFML in May 2023
Re: Are there any function that could change the coordinates system of window ?
«
Reply #3 on:
June 07, 2014, 08:53:31 pm »
Try setting your sf::View y size to a negative value, the effect is.. interesting (looks like it's working, but I never used that myself or felt the need for it), maybe you can work with that.
Logged
Back to C++ gamedev with SFML in May 2023
Laurent
Administrator
Hero Member
Posts: 32498
Re: Are there any function that could change the coordinates system of window ?
«
Reply #4 on:
June 07, 2014, 09:44:47 pm »
Inverting the view inverts... everything. Sprites, texts and everything are upside down.
Right now there's no easy way to invert the Y axis in SFML.
Logged
Laurent Gomila - SFML developer
FRex
Hero Member
Posts: 1848
Back to C++ gamedev with SFML in May 2023
Re: Are there any function that could change the coordinates system of window ?
«
Reply #5 on:
June 07, 2014, 10:19:26 pm »
Except for Text it's the desired effect it seems.
Wrapping RenderTarget and transforming everything before draw is a way too I guess.
Or just sticking to default for many guis and engines...
('inverted' y)
Logged
Back to C++ gamedev with SFML in May 2023
Print
Pages: [
1
]
SFML community forums
»
Help
»
Graphics
»
Are there any function that could change the coordinates system of window ?