Пример #1
0
        public void DrawMenu(string a, Color c, int h, int m)
        {
            Vector2 newwidth = CourierNew.MeasureString(a);
            Vector2 v        = new Vector2(GraphicsDevice.Viewport.Width / 2 - newwidth.X / 2, GraphicsDevice.Viewport.Height / 2 + h);

            MenuObject[m].X     = Convert.ToInt16(v.X); MenuObject[m].Y = Convert.ToInt16(v.Y);
            MenuObject[m].Width = Convert.ToInt16(newwidth.X); MenuObject[m].Height = Convert.ToInt16(newwidth.Y);
            if (MouseCollisionDetect(MenuObject[m]) == true)
            {
                c = Color.Yellow; SelectedMenuItem = m;
            }
            else
            {
                c = Color.White;
            }

            PlayerShip.DrawText(spriteBatch, CourierNew, a, v, c);
        }