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

Author Topic: VertexArray's images picking up extra pixel  (Read 1917 times)

0 Members and 1 Guest are viewing this topic.

Richy19

  • Full Member
  • ***
  • Posts: 190
    • View Profile
VertexArray's images picking up extra pixel
« 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:



It seems to be picking up a line of pixels from the tile bellow it on the tilesheet

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
VertexArray's images picking up extra pixel
« Reply #1 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.
Laurent Gomila - SFML developer

Richy19

  • Full Member
  • ***
  • Posts: 190
    • View Profile
VertexArray's images picking up extra pixel
« Reply #2 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?

 

anything