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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Raycast

Pages: [1]
1
Graphics / Sprite Source Rectangle Inaccurate?
« on: March 07, 2013, 06:54:00 am »
I've been using SFML for a while, and I've only found basic workarounds for this, and I've never found out why this happens.

I wrote a basic tile engine setup that I've been using for several projects. It's what you'd expect, a vector of a vector of tiles with integer positions and sprites which are cut out of a spritesheet using the IntRect argument of the Sprite constructor.

My issue is that when the camera is at certain positions, the tiles' sourcerects cut into the next tile in the spritesheet. It's a little hard to explain, so I made a gif of it.



Spritesheet:


Hopefully that helps.

I'm thinking it might possibly have to do with how SFML's View class works. When I cast the view's position to an int, this issue doesn't happen at the cost of smooth camera movement.

Has anyone else had this problem? What can I do about this?

Pages: [1]