Пример #1
0
        public MenuManager(GameScreen i_GamsScreen, int i_NumberOfButtens) : base(i_GamsScreen.Game)
        {
            m_MyScreen = i_GamsScreen;
            m_MyScreen.Add(this);
            m_NumberOfButtens = i_NumberOfButtens;
            m_SinglePlayer    = false;
            m_ButtenList      = new GameButten[m_NumberOfButtens];

            for (int i = 0; i < m_NumberOfButtens; i++)
            {
                m_ButtenList[i] = new GameButten(m_MyScreen, i.ToString(), i);
                m_ButtenList[i].OnMouseChangedButten += Button_OnMouseChangedButten;
                m_ButtenList[i].OnMouseLeftHover     += Button_OnMouseLeftHover;
                m_ButtenList[i].OnRsetsetButtens     += menuManager_OnRsetsetButtens;
            }
            this.Game.Window.ClientSizeChanged += menuManager_ClientSizeChanged;
            m_CurrentButton = null;
            m_MenuLabel     = new MenuLabel(m_MyScreen, "Press [Page UP / Down] Or (Mouse Right Butten/Scroll) To Naivate Between Button Options");
            m_ScreenTilte   = new ScreenTitle(m_MyScreen);
        }
Пример #2
0
        protected OverlayHeader()
        {
            RelativeSizeAxes = Axes.X;
            AutoSizeAxes     = Axes.Y;

            Add(new FillFlowContainer
            {
                RelativeSizeAxes = Axes.X,
                AutoSizeAxes     = Axes.Y,
                Direction        = FillDirection.Vertical,
                Children         = new[]
                {
                    HeaderInfo = new FillFlowContainer
                    {
                        RelativeSizeAxes = Axes.X,
                        AutoSizeAxes     = Axes.Y,
                        Direction        = FillDirection.Vertical,
                        Depth            = -float.MaxValue,
                        Children         = new[]
                        {
                            CreateBackground(),
                            new Container
                            {
                                RelativeSizeAxes = Axes.X,
                                AutoSizeAxes     = Axes.Y,
                                Children         = new Drawable[]
                                {
                                    titleBackground = new Box
                                    {
                                        RelativeSizeAxes = Axes.Both,
                                        Colour           = Color4.Gray,
                                    },
                                    new Container
                                    {
                                        RelativeSizeAxes = Axes.X,
                                        AutoSizeAxes     = Axes.Y,
                                        Padding          = new MarginPadding
                                        {
                                            Horizontal = UserProfileOverlay.CONTENT_X_MARGIN,
                                            Vertical   = 10,
                                        },
                                        Children = new[]
                                        {
                                            title = CreateTitle().With(title =>
                                            {
                                                title.Anchor = Anchor.CentreLeft;
                                                title.Origin = Anchor.CentreLeft;
                                            }),
                                            CreateTitleContent().With(content =>
                                            {
                                                content.Anchor = Anchor.CentreRight;
                                                content.Origin = Anchor.CentreRight;
                                            })
                                        }
                                    }
                                }
                            },
                        }
                    },
                    CreateContent()
                }
            });
        }