Beispiel #1
0
        public MainMenu(AssetManager AssetManager)
        {
            m_assetManager = AssetManager;
            buttonList     = new List <Button>();
            labelList      = new List <label>();
            backRect       = new Rectangle(0, 0, 800, 600);
            lblFound       = new label(m_assetManager.FontLib["UIHeader"]);
            lblNew         = new label(m_assetManager.FontLib["UIHeader"]);
            lblMatch       = new label(m_assetManager.FontLib["UIHeader"]);

            m_delay        = 20;
            m_sleepCounter = m_delay;

            txrBackGround = AssetManager.SpriteLib["BackGround_" + (Game1.RNG.Next(1, 7)).ToString()];
            createButtons();

            listBoxMap     = new Listbox(m_assetManager, 400, 100);
            listBoxSession = new Listbox(m_assetManager, 400, 200);
            listBoxMatch   = new Listbox(m_assetManager, 400, 350);
            getMapList();
            listBoxMap.Visible     = false;
            listBoxSession.Visible = false;

            createHeadings();

            setTitleScreen();
        }
Beispiel #2
0
        public void updateMe(MouseState mouseState)
        {
            Point mousePos = new Point(mouseState.X, mouseState.Y);

            if (m_visible)
            {
                foreach (label lbl in m_itemList)
                {
                    lbl.updateMe();
                    if (m_selected == lbl)
                    {
                        lbl.Selected = true;
                    }
                    else
                    {
                        lbl.Selected = false;
                    }

                    if (lbl.Rect.Contains(mousePos))
                    {
                        lbl.BackLit = true;
                        if ((mouseState.LeftButton == ButtonState.Pressed) && oldMouse.LeftButton == ButtonState.Released)
                        {
                            m_selected = lbl;
                        }
                    }
                    else if (lbl != m_selected)
                    {
                        lbl.BackLit = false;
                    }
                }
            }
            oldMouse = mouseState;
        }
Beispiel #3
0
 public inGameMenu(Game1 game, AssetManager assetManager)
 {
     _game         = game;
     _assetmanager = assetManager;
     _menuRect     = new Rectangle(0, 0, game.ScreenRes_X, game.ScreenRes_Y);
     _lBox         = new Listbox(assetManager, game.ScreenRes_X / 3, game.ScreenRes_Y / 3);
     _Backtint     = new Color(255, 255, 255, 100);
     _lBox.Font    = assetManager.FontLib["SegoeUI"];
     _lblHeader    = new label(assetManager.FontLib["UIHeader"]);
     _lBox.Spacing = 80;
     _lBox.Visible = true;
     _closed       = true;
 }
Beispiel #4
0
        public void Add(string Text)
        {
            label   newLable         = new label(_font);
            Vector2 stringDimensions = newLable.Font.MeasureString(Text);

            newLable.Text   = Text;
            newLable.Width  = (int)stringDimensions.X;
            newLable.Height = newLable.Font.LineSpacing;
            if (m_itemList.Count == 0)
            {
                newLable.Position = new Point(m_xpos, (m_ypos + m_rect.Height));
            }
            else
            {
                newLable.Position = new Point(m_xpos, m_itemList[m_itemList.Count - 1].Position.Y + _verticalSpacing);
            }

            m_itemList.Add(newLable);
        }