Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Screen view wont change  (Read 1407 times)

0 Members and 1 Guest are viewing this topic.

oOhttpOo

  • Newbie
  • *
  • Posts: 40
    • View Profile
Screen view wont change
« on: April 25, 2015, 03:37:56 pm »
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <SFML/System.hpp>
#include <Windows.h>


int main()
{
        sf::RenderWindow window1(sf::VideoMode(800, 700), "window");

        sf::Texture tx1;
        tx1.loadFromFile("pic.jpg");

        sf::Sprite st1;
        st1.setTexture(tx1);



        while (window1.isOpen())
        {
                sf::Event event1;
                while (window1.pollEvent(event1))
                {
                        if (event1.type == sf::Event::Closed)
                                window1.close();
                }



                window1.clear(sf::Color::Green);
                sf::View view1(sf::Vector2f(350, 300), sf::Vector2f(300, 300));

                view1.setCenter(200, 200);
                view1.move(400, 400);
                window1.draw(st1);

                window1.display();
        }
}
 
How do I make it work?

AlexxanderX

  • Full Member
  • ***
  • Posts: 128
    • View Profile
    • AlexanderX
Re: Screen view wont change
« Reply #1 on: April 25, 2015, 03:47:12 pm »
Maybe
window1.setView(view1);
?
Here you can find my blog and tutorials about SFML - http://alexanderx.net/ (died...) - http://web.archive.org/web/20160110002847/http://alexanderx.net/

oOhttpOo

  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: Screen view wont change
« Reply #2 on: April 25, 2015, 03:48:22 pm »
ooooooooooooooooooooooooooh k thx

 

anything