Exemplo n.º 1
0
 public void ChangeOrientaion(Type type)
 {
     var line = new Line2D(Point.Zero, Point.One, Color.Green);
     Window window = null;
     Input.InputCommands inputCommands = null;
     Renderer renderer = null;
     ScreenSpace screen = null;
     Mouse mouse = null;
     Start(type, (Resolver resolver) =>
     {
         window = resolver.Resolve<Window>();
         window.BackgroundColor = Color.Blue;
         inputCommands = resolver.Resolve<Input.InputCommands>();
         renderer = resolver.Resolve<Renderer>();
         screen = resolver.Resolve<ScreenSpace>();
         mouse = resolver.Resolve<Mouse>();
         renderer.Add(line);
         inputCommands.Add(Key.A, () => { window.TotalPixelSize = new Size(800, 480); });
         inputCommands.Add(Key.B, () => { window.TotalPixelSize = new Size(480, 800); });
     }, delegate
     {
         var startPosition = screen.Viewport.TopLeft;
         var endPosition = screen.Viewport.BottomRight;
         window.Title = "Size: " + window.ViewportPixelSize + " Start: " + startPosition + " End: " +
             endPosition;
         line.StartPosition = startPosition;
         line.EndPosition = endPosition;
     });
 }
Exemplo n.º 2
0
 public void ChangeOrientaion(Type type)
 {
     var line = new Line2D(Point.Zero, Point.One, Color.Green);
     Start(type, (Window window, InputCommands inputCommands, Renderer renderer) =>
     {
         window.BackgroundColor = Color.Blue;
         renderer.Add(line);
         inputCommands.Add(Key.A, () => { window.TotalPixelSize = new Size(800, 480); });
         inputCommands.Add(Key.B, () => { window.TotalPixelSize = new Size(480, 800); });
     }, (ScreenSpace screen, Window window) =>
     {
         var startPosition = screen.Viewport.TopLeft;
         var endPosition = screen.Viewport.BottomRight;
         window.Title = "Size: " + window.ViewportPixelSize + " Start: " + startPosition + " End: " +
             endPosition;
         line.StartPosition = startPosition;
         line.EndPosition = endPosition;
     });
 }