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

Author Topic: Question about pixels  (Read 2235 times)

0 Members and 1 Guest are viewing this topic.

iceman1992

  • Newbie
  • *
  • Posts: 6
    • View Profile
Question about pixels
« on: July 17, 2012, 07:11:16 pm »
Is the topleftmost pixel (0,0) or (1,1)?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11033
    • View Profile
    • development blog
    • Email
Re: Question about pixels
« Reply #1 on: July 17, 2012, 07:25:37 pm »
You could have tesred that easily and afaik it's also in the documentation
.

It's (0,0).
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

iceman1992

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Question about pixels
« Reply #2 on: July 17, 2012, 07:32:49 pm »
You could have tesred that easily and afaik it's also in the documentation
How can I test that? Thanks for the answer  :)

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11033
    • View Profile
    • development blog
    • Email
Re: Question about pixels
« Reply #3 on: July 17, 2012, 07:46:04 pm »
You could have tesred that easily and afaik it's also in the documentation
How can I test that? Thanks for the answer  :)
Create a sprite set the position to (0,0) look where the sprite gets drawn, to verify change the position to (1,1) and look again at the drawing. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

eigen

  • Jr. Member
  • **
  • Posts: 64
  • Brobdingnagian ding dong
    • View Profile
    • Pioneersgame.com
Re: Question about pixels
« Reply #4 on: July 18, 2012, 01:40:01 pm »
Is the topleftmost pixel (0,0) or (1,1)?

C++ and most other languages have 0 based indexes. While some might argue if this should be the case in the high-level languages of today, it is, which means it also applies to SFML and its pixel coordinates :)

iceman1992

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Question about pixels
« Reply #5 on: July 20, 2012, 01:18:18 pm »
Sorry for the late reply. Thanks everyone  :)