Hi, I've been trying to get LTBL to work with my Tile-based 2D SFML game.
I made the necessary changes to 1.5.1 to get it to work with the latest SFML (changing to sf::Texture::bind() etc). I finally got it working except the shadows always come up in the wrong place. What gives?
I'm using the tmx (Tiled) map format for my levels, and constructing the hulls based on collision objects read in from the loader. I've checked the debug drawing and the hulls are all in their correct places and the light is where it should be but the shadows are simply drawing for things that don't exist.
Anyone encounter this issue and know how to fix it?
[EDIT] Ok so I figured out the issue, the Hull verticies are relative to 0, 0 so I had to basically take the hull box being read in by loader and subtract it's width/height from the vertex position to get the correct location for the hull's placement.
However I've found that the hulls are only relative to your viewport/window. For instance, I have a 1024 x 768 Tile map (of which tiles are 32x32 so that's 32x24 tiles). When I try to place the Hull using SetWorldCenter, it comes up with the wrong y coordinate whenever I just get the center location from the loader. But if I use the Window's height and subtract the Hull's y from it, then it is placed properly. So the question is: how would I handle this with varying map sizes since it seems the hulls are all relative to the window?