Exemple #1
0
        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            Canvas.SetLeft(this.BigBorder, (ConCanvas.ActualWidth - this.BigBorder.ActualWidth) / 2);
            Canvas.SetTop(this.BigBorder, (ConCanvas.ActualHeight - this.BigBorder.ActualHeight) / 2);
            BaseLayoutView view = new BaseLayoutView()
            {
                _CurreLayout = Layouts.LeftUp
            };

            this.LeftUpFrame.Children.Add(view);

            view = new BaseLayoutView()
            {
                _CurreLayout = Layouts.RightUp
            };
            this.RightUpFrame.Children.Add(view);

            view = new BaseLayoutView()
            {
                _CurreLayout = Layouts.LeftBottom
            };
            this.LeftBottonFrame.Children.Add(view);

            view = new BaseLayoutView()
            {
                _CurreLayout = Layouts.RightBotton
            };
            this.RightBottonFrame.Children.Add(view);
        }
        public IUITextBox CreateTextBox(Rectangle rectangle, BaseLayoutView layoutView, Action <string> onTextChange = null)
        {
            var xnaUiTextBox = new XnaUITextBox(this, rectangle, layoutView, onTextChange);

            TextBoxes.Add(xnaUiTextBox);
            return(xnaUiTextBox);
        }
Exemple #3
0
 public XnaUITextBox(IUIManager uiManager, Rectangle rectangle, BaseLayoutView layoutView, Action <string> onTextChange)
 {
     UIManager    = uiManager;
     Rectangle    = rectangle;
     LayoutView   = layoutView;
     OnTextChange = onTextChange;
 }
Exemple #4
0
 public BaseLayout SetLayout(BaseLayoutView layoutView)
 {
     LayoutView = layoutView;
     layoutView.TouchManager = new TouchManager(Screen.ScreenManager.Client);
     layoutView.Layout       = this;
     layoutView.Renderer     = Screen.ScreenManager.Client.Game.Renderer;
     layoutView.Client       = Screen.ScreenManager.Client;
     return(this);
 }
        public IScreen CreateDefaultScreenLayout(BaseLayoutView layoutView)
        {
            var screen = CreateScreen();

            screen
            .CreateLayout(DefaultScreenSize.Width, DefaultScreenSize.Height)
            .MakeActive()
            .SetScreenOrientation(ScreenOrientation.Vertical)
            .SetLayout(layoutView);
            return(screen);
        }