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.

Messages - Raycast

Pages: [1]
Graphics / Re: Sprite Source Rectangle Inaccurate?
« on: March 09, 2013, 01:47:58 am »
For anyone else who has had this problem, rounding the View's position to an int works well. If you have any camera interpolation or something, just make sure you round it after all transformations.

SFML projects / Re: New RichText class
« on: March 07, 2013, 09:53:54 am »
I'm not sure if this is my fault or not, but I'm getting this:

Related code snippet:
std::vector<sf::RichText> textList;

textList.push_back(sf::RichText("*bold*, ~italic~, _underlined_", debugFont, 32));
textList.push_back(sf::RichText("unicode: áéíóúçÆæÞðë", debugFont, 32));
textList.push_back(sf::RichText("#red red, #green green, #blue blue", debugFont, 32));
textList.push_back(sf::RichText("#ff6600 sexy #33ff99 hex #9933ff code #ff33cc support!", debugFont, 32));
textList.push_back(sf::RichText("#ffff33 ~*_EVERYTHING AT ONCE :D_*~", debugFont, 32));
textList.push_back(sf::RichText("#white Escaping format characters is supported: \~\*\#\_", debugFont, 32)); //This line triggers "Debug Assertion Failed! Line:1675, Expression: string subscript out of range."

for(int i = 0; i < textList.size(); i++)
        textList[i].setPosition(4, i * 45);
        engine.window->draw(textList[i], sf::RenderStates::Default);

Graphics / Re: Sprite Source Rectangle Inaccurate?
« on: March 07, 2013, 08:16:52 am »
Ah, alright. Thanks. I'll see if I can work around it.

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.


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]