Пример #1
0
        //----------------------------------------------------------------------
        public Screen( NuclearWinter.NuclearGame _game, Style _style, int _iWidth, int _iHeight )
        {
            Game    = _game;
            Style   = _style;
            Width   = _iWidth;
            Height  = _iHeight;

            Root    = new Group( this );
        }
Пример #2
0
        //----------------------------------------------------------------------
        public MainMenuManager(Game _game, NuclearUI.Style UIstyle, ContentManager _content)
            : base(_game, UIstyle, _content)
        {
            NuclearUI.Button button = new NuclearUI.Button(MenuScreen, "TestButton");

            // Splitter
            mSplitter = new NuclearUI.Splitter(MenuScreen, NuclearUI.Direction.Up);
            mSplitter.AnchoredRect = NuclearUI.AnchoredRect.CreateCentered(500, 400);// CreateFull(100, 100, 100, 100);
            MenuScreen.Root.AddChild(mSplitter);
            mSplitter.Collapsable = true;

            mSplitter.FirstPaneMinSize = 100;

            // Demo list
            var demosBoxGroup = new NuclearUI.BoxGroup(MenuScreen, NuclearUI.Orientation.Horizontal, 0, NuclearUI.Anchor.Start);

            mSplitter.FirstPane = demosBoxGroup;

            mDemoPanel = new NuclearUI.Panel(
                MenuScreen, Content.Load <Texture2D>("Textures/UI/Panel04"),
                MenuScreen.Style.PanelCornerSize);

            var basicDemoPane = new DemoMenus.BasicDemoPane(this);

            mSplitter.SecondPane = mDemoPanel;

            mDemoPanel.AddChild(basicDemoPane);

            // Test button
            var testButton = new NuclearUI.Button(MenuScreen, "Test");

            testButton.ClickHandler = delegate
            {
                mDemoPanel.Clear();
            };

            demosBoxGroup.AddChild(CreateDemoButton("Basic", basicDemoPane), true);
            demosBoxGroup.AddChild(testButton, true);

            //demosBoxGroup.AddChild( CreateDemoButton( "Notebook", new Demos.NotebookPane( this ) ), true );
            //demosBoxGroup.AddChild( CreateDemoButton( "Text Area", new Demos.TextAreaPane( this ) ), true );
            //demosBoxGroup.AddChild( CreateDemoButton( "Custom Viewport", new Demos.CustomViewportPane( this ) ), true );
        }
Пример #3
0
        //----------------------------------------------------------------------
        protected override void LoadContent()
        {
            base.LoadContent();

            //------------------------------------------------------------------
            // UI Style
            UIStyle = new NuclearUI.Style();

            UIStyle.SmallFont      = new NuclearUI.UIFont(Content.Load <SpriteFont>("Fonts/SmallFont"), 14, 0);
            UIStyle.MediumFont     = new NuclearUI.UIFont(Content.Load <SpriteFont>("Fonts/MediumFont"), 18, -2);
            UIStyle.LargeFont      = new NuclearUI.UIFont(Content.Load <SpriteFont>("Fonts/LargeFont"), 24, 0);
            UIStyle.ExtraLargeFont = new NuclearUI.UIFont(Content.Load <SpriteFont>("Fonts/LargeFont"), 24, 0);

            UIStyle.SpinningWheel = Content.Load <Texture2D>("Sprites/UI/SpinningWheel");

            UIStyle.DefaultTextColor    = new Color(224, 224, 224);
            UIStyle.DefaultButtonHeight = 60;

            UIStyle.ButtonFrame        = Content.Load <Texture2D>("Sprites/UI/ButtonFrame");
            UIStyle.ButtonDownFrame    = Content.Load <Texture2D>("Sprites/UI/ButtonFrameDown");
            UIStyle.ButtonHoverOverlay = Content.Load <Texture2D>("Sprites/UI/ButtonHover");
            UIStyle.ButtonFocusOverlay = Content.Load <Texture2D>("Sprites/UI/ButtonFocus");
            UIStyle.ButtonDownOverlay  = Content.Load <Texture2D>("Sprites/UI/ButtonPress");

            UIStyle.TooltipFrame = Content.Load <Texture2D>("Sprites/UI/TooltipFrame");

            UIStyle.ButtonCornerSize        = 20;
            UIStyle.ButtonVerticalPadding   = 10;
            UIStyle.ButtonHorizontalPadding = 15;

            UIStyle.RadioButtonCornerSize  = UIStyle.ButtonCornerSize;
            UIStyle.RadioButtonFrameOffset = 7;
            UIStyle.ButtonFrameLeft        = Content.Load <Texture2D>("Sprites/UI/ButtonFrameLeft");
            UIStyle.ButtonDownFrameLeft    = Content.Load <Texture2D>("Sprites/UI/ButtonFrameLeftDown");

            UIStyle.ButtonFrameMiddle     = Content.Load <Texture2D>("Sprites/UI/ButtonFrameMiddle");
            UIStyle.ButtonDownFrameMiddle = Content.Load <Texture2D>("Sprites/UI/ButtonFrameMiddleDown");

            UIStyle.ButtonFrameRight     = Content.Load <Texture2D>("Sprites/UI/ButtonFrameRight");
            UIStyle.ButtonDownFrameRight = Content.Load <Texture2D>("Sprites/UI/ButtonFrameRightDown");

            UIStyle.EditBoxFrame      = Content.Load <Texture2D>("Sprites/UI/EditBoxFrame");
            UIStyle.EditBoxCornerSize = 20;

            UIStyle.Panel           = Content.Load <Texture2D>("Sprites/UI/Panel01");
            UIStyle.PanelCornerSize = 15;

            UIStyle.NotebookStyle.TabCornerSize   = 15;
            UIStyle.NotebookStyle.Tab             = Content.Load <Texture2D>("Sprites/UI/Tab");
            UIStyle.NotebookStyle.TabFocus        = Content.Load <Texture2D>("Sprites/UI/ButtonFocus");
            UIStyle.NotebookStyle.ActiveTab       = Content.Load <Texture2D>("Sprites/UI/ActiveTab");
            UIStyle.NotebookStyle.ActiveTabFocus  = Content.Load <Texture2D>("Sprites/UI/ActiveTabFocused");
            UIStyle.NotebookStyle.TabClose        = Content.Load <Texture2D>("Sprites/UI/TabClose");
            UIStyle.NotebookStyle.TabCloseHover   = Content.Load <Texture2D>("Sprites/UI/TabCloseHover");
            UIStyle.NotebookStyle.TabCloseDown    = Content.Load <Texture2D>("Sprites/UI/TabCloseDown");
            UIStyle.NotebookStyle.UnreadTabMarker = Content.Load <Texture2D>("Sprites/UI/UnreadTabMarker");

            UIStyle.ListViewStyle.ListViewFrame           = Content.Load <Texture2D>("Sprites/UI/ListFrame");
            UIStyle.ListViewStyle.ListViewFrameCornerSize = 10;
            UIStyle.ListRowInsertMarker = Content.Load <Texture2D>("Sprites/UI/ListRowInsertMarker");

            UIStyle.ListViewStyle.CellFrame         = Content.Load <Texture2D>("Sprites/UI/ListRowFrame");
            UIStyle.ListViewStyle.CellCornerSize    = 10;
            UIStyle.ListViewStyle.SelectedCellFrame = Content.Load <Texture2D>("Sprites/UI/ListRowFrameSelected");
            UIStyle.ListViewStyle.CellFocusOverlay  = Content.Load <Texture2D>("Sprites/UI/ListRowFrameFocused");
            UIStyle.ListViewStyle.CellHoverOverlay  = Content.Load <Texture2D>("Sprites/UI/ListRowFrameHover");
            UIStyle.ListViewStyle.ColumnHeaderFrame = Content.Load <Texture2D>("Sprites/UI/ButtonFrame");  // FIXME

            UIStyle.PopupFrame           = Content.Load <Texture2D>("Sprites/UI/PopupFrame");
            UIStyle.PopupFrameCornerSize = 30;

            UIStyle.CheckBoxFrame      = Content.Load <Texture2D>("Sprites/UI/EditBoxFrame");
            UIStyle.CheckBoxFrameHover = Content.Load <Texture2D>("Sprites/UI/CheckBoxFrameHover");
            UIStyle.CheckBoxChecked    = Content.Load <Texture2D>("Sprites/UI/Checked");
            UIStyle.CheckBoxUnchecked  = Content.Load <Texture2D>("Sprites/UI/Unchecked");

            UIStyle.SliderFrame = Content.Load <Texture2D>("Sprites/UI/ListFrame");

            UIStyle.VerticalScrollbar           = Content.Load <Texture2D>("Sprites/UI/VerticalScrollbar");
            UIStyle.VerticalScrollbarCornerSize = 5;

            UIStyle.DropDownBoxEntryHoverOverlay = Content.Load <Texture2D>("Sprites/UI/ListRowFrameFocused");
            UIStyle.DropDownArrow = Content.Load <Texture2D>("Sprites/UI/DropDownArrow");

            UIStyle.SplitterFrame         = Content.Load <Texture2D>("Sprites/UI/SplitterFrame");
            UIStyle.SplitterDragHandle    = Content.Load <Texture2D>("Sprites/UI/SplitterDragHandle");
            UIStyle.SplitterCollapseArrow = Content.Load <Texture2D>("Sprites/UI/SplitterCollapseArrow");

            UIStyle.ProgressBarFrame           = Content.Load <Texture2D>("Sprites/UI/EditBoxFrame");
            UIStyle.ProgressBarFrameCornerSize = 15;
            UIStyle.ProgressBar           = Content.Load <Texture2D>("Sprites/UI/ProgressBar");
            UIStyle.ProgressBarCornerSize = 15;

            UIStyle.TextAreaFrame            = Content.Load <Texture2D>("Sprites/UI/ListFrame");
            UIStyle.TextAreaFrameCornerSize  = 15;
            UIStyle.TextAreaGutterFrame      = Content.Load <Texture2D>("Sprites/UI/TextAreaGutterFrame");
            UIStyle.TextAreaGutterCornerSize = 15;

#if !FNA
            EnsureProperPresentationParams();
#endif
        }
Пример #4
0
        //----------------------------------------------------------------------
        protected override void LoadContent()
        {
            base.LoadContent();

            //------------------------------------------------------------------
            // UI Style
            UIStyle = new NuclearUI.Style();

            UIStyle.SmallFont   = new NuclearUI.UIFont( Content.Load<SpriteFont>( "Fonts/SmallFont" ), 14, 0 );
            UIStyle.MediumFont  = new NuclearUI.UIFont( Content.Load<SpriteFont>( "Fonts/MediumFont" ), 18, -2 );
            UIStyle.LargeFont   = new NuclearUI.UIFont( Content.Load<SpriteFont>( "Fonts/LargeFont" ), 24, 0 );

            UIStyle.BlurRadius = 0;
            UIStyle.SpinningWheel               = Content.Load<Texture2D>( "Sprites/UI/SpinningWheel" );

            UIStyle.DefaultTextColor            = new Color( 224, 224, 224 );
            UIStyle.DefaultButtonHeight         = 60;

            UIStyle.ButtonFrame                 = Content.Load<Texture2D>( "Sprites/UI/ButtonFrame" );
            UIStyle.ButtonHover                 = Content.Load<Texture2D>( "Sprites/UI/ButtonHover" );
            UIStyle.ButtonFocus                 = Content.Load<Texture2D>( "Sprites/UI/ButtonFocus" );

            UIStyle.ButtonFrameDown             = Content.Load<Texture2D>( "Sprites/UI/ButtonFrameDown" );
            UIStyle.ButtonPress                 = Content.Load<Texture2D>( "Sprites/UI/ButtonPress" );
            UIStyle.ButtonDownFocus             = Content.Load<Texture2D>( "Sprites/UI/ButtonFocus" );

            UIStyle.TooltipFrame                = Content.Load<Texture2D>( "Sprites/UI/TooltipFrame" );

            UIStyle.ButtonCornerSize            = 20;
            UIStyle.ButtonVerticalPadding       = 10;
            UIStyle.ButtonHorizontalPadding     = 15;

            UIStyle.RadioButtonCornerSize       = UIStyle.ButtonCornerSize;
            UIStyle.RadioButtonFrameOffset      = 7;
            UIStyle.ButtonFrameLeft             = Content.Load<Texture2D>( "Sprites/UI/ButtonFrameLeft" );
            UIStyle.ButtonFrameLeftDown         = Content.Load<Texture2D>( "Sprites/UI/ButtonFrameLeftDown" );

            UIStyle.ButtonFrameMiddle           = Content.Load<Texture2D>( "Sprites/UI/ButtonFrameMiddle" );
            UIStyle.ButtonFrameMiddleDown       = Content.Load<Texture2D>( "Sprites/UI/ButtonFrameMiddleDown" );

            UIStyle.ButtonFrameRight            = Content.Load<Texture2D>( "Sprites/UI/ButtonFrameRight" );
            UIStyle.ButtonFrameRightDown        = Content.Load<Texture2D>( "Sprites/UI/ButtonFrameRightDown" );

            UIStyle.EditBoxFrame                = Content.Load<Texture2D>( "Sprites/UI/EditBoxFrame" );
            UIStyle.EditBoxCornerSize           = 20;

            UIStyle.Panel                       = Content.Load<Texture2D>( "Sprites/UI/Panel01" );
            UIStyle.PanelCornerSize             = 15;

            UIStyle.NotebookTabCornerSize       = 15;
            UIStyle.NotebookTab                 = Content.Load<Texture2D>( "Sprites/UI/Tab" );
            UIStyle.NotebookTabFocus            = Content.Load<Texture2D>( "Sprites/UI/ButtonFocus" );
            UIStyle.NotebookActiveTab           = Content.Load<Texture2D>( "Sprites/UI/ActiveTab" );
            UIStyle.NotebookActiveTabFocus      = Content.Load<Texture2D>( "Sprites/UI/ActiveTabFocused" );
            UIStyle.NotebookTabClose            = Content.Load<Texture2D>( "Sprites/UI/TabClose" );
            UIStyle.NotebookTabCloseHover       = Content.Load<Texture2D>( "Sprites/UI/TabCloseHover" );
            UIStyle.NotebookTabCloseDown        = Content.Load<Texture2D>( "Sprites/UI/TabCloseDown" );
            UIStyle.NotebookUnreadTabMarker     = Content.Load<Texture2D>( "Sprites/UI/UnreadTabMarker" );

            UIStyle.ListFrame                   = Content.Load<Texture2D>( "Sprites/UI/ListFrame" );
            UIStyle.ListRowInsertMarker         = Content.Load<Texture2D>( "Sprites/UI/ListRowInsertMarker" );

            UIStyle.GridBoxFrameCornerSize      = 10;
            UIStyle.GridBoxFrame                = Content.Load<Texture2D>( "Sprites/UI/ListRowFrame" );
            UIStyle.GridBoxFrameSelected        = Content.Load<Texture2D>( "Sprites/UI/ListRowFrameSelected" );
            UIStyle.GridBoxFrameFocus           = Content.Load<Texture2D>( "Sprites/UI/ListRowFrameFocused" );
            UIStyle.GridBoxFrameHover           = Content.Load<Texture2D>( "Sprites/UI/ListRowFrameHover" );
            UIStyle.GridHeaderFrame             = Content.Load<Texture2D>( "Sprites/UI/ButtonFrame" ); // FIXME

            UIStyle.PopupFrame                  = Content.Load<Texture2D>( "Sprites/UI/PopupFrame" );
            UIStyle.PopupFrameCornerSize        = 30;

            UIStyle.TreeViewContainerFrameSelected = Content.Load<Texture2D>( "Sprites/UI/TreeViewContainerFrameSelected" );

            UIStyle.TreeViewBranchOpen          = Content.Load<Texture2D>( "Sprites/UI/TreeViewBranchOpen" );
            UIStyle.TreeViewBranchOpenEmpty     = Content.Load<Texture2D>( "Sprites/UI/TreeViewBranchOpenEmpty" );
            UIStyle.TreeViewBranchClosed        = Content.Load<Texture2D>( "Sprites/UI/TreeViewBranchClosed" );
            UIStyle.TreeViewBranch              = Content.Load<Texture2D>( "Sprites/UI/TreeViewBranch" );
            UIStyle.TreeViewBranchLast          = Content.Load<Texture2D>( "Sprites/UI/TreeViewBranchLast" );
            UIStyle.TreeViewLine                = Content.Load<Texture2D>( "Sprites/UI/TreeViewLine" );
            UIStyle.TreeViewCheckBoxFrame       = Content.Load<Texture2D>( "Sprites/UI/TreeViewCheckBoxFrame" );

            UIStyle.CheckBoxFrameHover          = Content.Load<Texture2D>( "Sprites/UI/CheckBoxFrameHover" );
            UIStyle.CheckBoxChecked             = Content.Load<Texture2D>( "Sprites/UI/Checked" );
            UIStyle.CheckBoxUnchecked           = Content.Load<Texture2D>( "Sprites/UI/Unchecked" );

            UIStyle.VerticalScrollbar           = Content.Load<Texture2D>( "Sprites/UI/VerticalScrollbar" );
            UIStyle.VerticalScrollbarCornerSize = 5;

            UIStyle.DropDownArrow               = Content.Load<Texture2D>( "Sprites/UI/DropDownArrow" );
            UIStyle.SplitterFrame               = Content.Load<Texture2D>( "Sprites/UI/SplitterFrame" );
            UIStyle.SplitterDragHandle          = Content.Load<Texture2D>( "Sprites/UI/SplitterDragHandle" );
            UIStyle.SplitterCollapseArrow       = Content.Load<Texture2D>( "Sprites/UI/SplitterCollapseArrow" );

            UIStyle.ProgressBarFrame            = Content.Load<Texture2D>( "Sprites/UI/EditBoxFrame" );
            UIStyle.ProgressBarFrameCornerSize  = 15;
            UIStyle.ProgressBar                 = Content.Load<Texture2D>( "Sprites/UI/ProgressBar" );
            UIStyle.ProgressBarCornerSize       = 15;

            UIStyle.TextAreaGutterFrame         = Content.Load<Texture2D>( "Sprites/UI/TextAreaGutterFrame" );
            UIStyle.TextAreaGutterCornerSize    = 15;

            EnsureProperPresentationParams();
        }