void Graphics::render(unsigned char id, float x, float y) {
sf::Sprite sprite;
sprite.setTexture(*tileset);
sf::IntRect rect;
rect.left = id % 16 * 16;
rect.top = id / 16 * 24;
rect.width = 16;
rect.height = 24;
sprite.setTextureRect(rect);
sprite.setScale(sf::Vector2f(2.0f, 2.0f));
sprite.setPosition(sf::Vector2f(x, y));
window->draw(sprite);
}
There is one texture for the game, it's a 16 x 16 tile sheet with each tile having a size of 16 x 24px. When I display a tile, it will show a thin line of the tile below it. I can't figure out why it would display more than the 16 x 24. Please help.