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

Pages: [1]
1
Graphics / Re: A simple question of resolution problem
« on: April 21, 2017, 08:36:30 pm »
Thanks, but i'm sure that the problem ocurred with others images without transparency. I'll check it anyway!

2
Graphics / A simple question of resolution problem
« on: April 21, 2017, 07:30:22 pm »
Hello, i have the following problem:

My game is designed to 1920x1080 screen resolutions, but in my PC the screen is 1600x900... well, i thought, it's the same aspect ratio (16:9), so i should not have problems scaling images from 1920.. to 1600... but yes!, i have problems! I attached the original image, and the scaled image, and you can see the differents.

I tried to use view, scale texture, i read N posts in this forum, etc. but ever had the same problem. My code is the following:

int main()
{
        bool finish = false;
        sf::RenderWindow window;

        sf::Texture texture;
        sf::Sprite sprite;

        texture.loadFromFile("resources\\FirstBKGRND.png");
        sprite.setTexture(texture);
        sprite.setPosition(sf::Vector2f(0, 0));
        window.create(sf::VideoMode(1600, 900, 32), "Donuts", sf::Style::Fullscreen);


        sf::View view;
        view.reset(sf::FloatRect(0, 0, 1920, 1080));
        view.setViewport(sf::FloatRect(0.f, 0.f, 1.f, 1.f));
        window.setView(view);

        while (!finish)
        {
                sf::Event event;
                while (window.pollEvent(event))
                {
                        if (event.type == sf::Event::Closed)
                                finish = true;
                }

                window.clear(sf::Color::White);
                window.draw(sprite);
                window.display();
        }
        return 0;
}

 

I hope that you can help me!

Pages: [1]