SFML community forums

Help => Graphics => Topic started by: Richy19 on February 28, 2012, 10:14:00 pm

Title: VertexArray's images picking up extra pixel
Post by: Richy19 on February 28, 2012, 10:14:00 pm
I moved my map from lots of sprites to just 1 vertex array and I was messing around with the window view making it follow the mouse(as in the future I will make it follow he player) and I get transparent lines at some positions.
this is the code:
Code: [Select]
SFML.Graphics.View view = new SFML.Graphics.View(new SFML.Window.Vector2f(wid/2.0f,80)
, new SFML.Window.Vector2f(wid,160));

window.SetView(view);


And this is what happens:

(http://i.imgur.com/XZNsp.png)

It seems to be picking up a line of pixels from the tile bellow it on the tilesheet
Title: VertexArray's images picking up extra pixel
Post by: Laurent on February 29, 2012, 08:02:31 am
This can happen when the using decimal coordinates, or when the size of the view is not a multiple of the size of the window.
Title: VertexArray's images picking up extra pixel
Post by: Richy19 on February 29, 2012, 01:37:39 pm
Quote from: "Laurent"
This can happen when the using decimal coordinates, or when the size of the view is not a multiple of the size of the window.


So i should use floats as the findow position and center?
And if the window is 640x640 then I can use 160 as the view size right?