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 - isaiah0311

Pages: [1]
1
Graphics / Re: Sprite is showing outside texture rect
« on: August 14, 2020, 12:37:51 am »
Solved the issue. I had anti-aliasing set to 16. By setting to 8 or lower it removes this issue. I had not had this problem before when working with 16 x 16px tiles, only 16 x 24px.

2
Graphics / Re: Sprite is showing outside texture rect
« on: August 14, 2020, 12:00:58 am »
No, should I?

3
Graphics / Sprite is showing outside texture rect
« on: August 13, 2020, 10:16:03 pm »
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.

Pages: [1]