Ejemplo n.º 1
0
        public override Scene CreateScene(Microsoft.Xna.Framework.Graphics.GraphicsDevice graphics, Serialization.ContentLoader content)
        {
            var scene = new Scene();
            var font  = content.Load <SpriteFont>("Fonts/Consolas.spritefont");

            var window1 = new DialogWindow();

            window1.Viewport          = new Rectangle(20, 50, 340, 195);
            window1.WindowBorderBrush = new SolidColorBrush(new Color(106, 172, 246));
            window1.Background        = new SolidColorBrush(new Color(255, 255, 255));
            window1.TitleFont         = font;
            window1.Title             = "FPS Graph";
            window1.Content           = new FPSGraph {
                Margin = new Thickness(10)
            };

            var window2 = new DialogWindow();

            window2.Viewport          = new Rectangle(20, 255, 340, 195);
            window2.WindowBorderBrush = new SolidColorBrush(new Color(106, 172, 246));
            window2.Background        = new SolidColorBrush(new Color(255, 255, 255));
            window2.TitleFont         = font;
            window2.Title             = "Memory Graph";
            window2.Content           = new MemoryGraph()
            {
                Margin = new Thickness(10)
            };

            var window3 = new DialogWindow();

            window3.Viewport          = new Rectangle(370, 50, 620, 400);
            window3.WindowBorderBrush = new SolidColorBrush(new Color(106, 172, 246));
            window3.Background        = new SolidColorBrush(new Color(255, 255, 255));
            window3.TitleFont         = font;
            window3.Title             = "Tab Control";
            window3.Content           = new TabControl();

            var window4 = new DialogWindow();

            window4.Viewport          = new Rectangle(1000, 50, 270, 710);
            window4.WindowBorderBrush = new SolidColorBrush(new Color(106, 172, 246));
            window4.Background        = new SolidColorBrush(new Color(255, 255, 255));
            window4.TitleFont         = font;
            window4.Title             = "";

            var window5 = new DialogWindow();

            window5.Viewport          = new Rectangle(20, 460, 970, 300);
            window5.WindowBorderBrush = new SolidColorBrush(new Color(106, 172, 246));
            window5.Background        = new SolidColorBrush(new Color(255, 255, 255));
            window5.TitleFont         = font;
            window5.Title             = "Console";
            window5.ResizeMode        = Graphics.UI.ResizeMode.NoResize;
            window5.Content           = new TextBox(font)
            {
                Text       = ">",
                Foreground = Color.Black,
            };

            var manager = new WindowManager();

            manager.Windows.Add(window1);
            manager.Windows.Add(window2);
            manager.Windows.Add(window3);
            manager.Windows.Add(window4);
            manager.Windows.Add(window5);
            scene.Add(manager);

            return(scene);
        }
Ejemplo n.º 2
0
        public override Scene CreateScene(Microsoft.Xna.Framework.Graphics.GraphicsDevice graphics, Serialization.ContentLoader content)
        {
            var scene = new Scene();
            var font  = content.Load <SpriteFont>("Fonts/Consolas.spritefont");

            Border border = new Border {
                Background = content.Load <Texture2D>("textures/checker.bmp"),
                Height     = 500,
            };

            ScrollContentPresenter scrollPresenter = new ScrollContentPresenter();

            scrollPresenter.Content = border;

            ScrollViewer scrollViewer = new ScrollViewer();

            scrollViewer.CanVerticallyScroll = true;
            scrollViewer.Content             = scrollPresenter;

            Grid grid = new Grid(
                new ColumnDefinition[] {
                new ColumnDefinition(),
                new ColumnDefinition(400, GridUnitType.Pixel),
                new ColumnDefinition(),
            }, new RowDefinition[] {
                new RowDefinition(),
                new RowDefinition(300, GridUnitType.Pixel),
                new RowDefinition(),
            });

            grid.ShowGridLines = true;
            grid.Background    = new SolidColorBrush(Color.Black);

            Grid.SetColumn(scrollViewer, 1);
            Grid.SetRow(scrollViewer, 1);
            grid.Children.Add(scrollViewer);

            Window window = new Window();

            window.Content = grid;
            scene.Add(window);

            scrollPresenter.SetVerticalOffset(0.5f);

            return(scene);
        }