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.


Topics - R0M41K

Pages: [1]
1
Graphics / view.Viewport.Top doesn`t work
« on: January 23, 2017, 04:31:18 pm »
Hello there.
Writing on SFML.NET. When i use the view.Viewport.Top or view.Viewport.Left, it's results in 0, although it should be -100 in my case. What's the problem? How can i get the position of my camera?
        static void Main()
        {
            RenderWindow window = new RenderWindow(new Window.VideoMode(500, 300), "test");
            View view = new View(new Vector2f(-100,-100), window.GetView().Size);
            window.Closed += (o, a) => window.Close();
            CircleShape circle = new CircleShape(20);

            while (window.IsOpen())
            {
                Console.WriteLine(view.Viewport.Top);
                window.SetView(view);
                window.Draw(circle);
                window.DispatchEvents();
                window.Display();
                window.Clear();
            }
        }
 

Pages: [1]