SFML community forums

Help => Window => Topic started by: tanders12 on May 17, 2011, 03:11:34 am

Title: Pixels off by one.
Post by: tanders12 on May 17, 2011, 03:11:34 am
Ok I'm sure the answer to my question is somewhere in the forums but doing a search for the title didn't get me to far.

When you define a window or a rectangle to be a certain size, does that define the actual size or the number of pixels? For example, if I make a window of size 100x100, the upper-left pixel is (0,0), correct? So is the bottom-right pixel (99,99) or (100,100)? If it's (100,100) then the actual size would be 101x101.

The problem I'm having is that I'm referring to positions within the window using constants that are ratios of the full window size, and I suspect that they are off by just a little bit because I'm assuming the size is 100x100. I hope this makes sense...
Title: Pixels off by one.
Post by: PhiLLe on May 17, 2011, 06:44:55 am
In my understanding the size is 100x100 (0x0 to 99x99). At least that how it is everywhere else and I never had a 1 pixel border at two sides when I used background sprites.