Exemple #1
0
        public void Draw(GameTime time_)
        {
            int     count = menuItems.Count;
            Vector2 itemOffset;
            Vector2 position = new Vector2(menuPosition.X, menuPosition.Y);

            fontManager.Begin("Arial");
            SpriteFont arial = fontManager.GetFont("Arial");

            fontManager.Draw(position, menuItems[itemIndex], Color.Yellow);
            itemOffset  = arial.MeasureString(menuItems[itemIndex]);
            position.Y += itemOffset.Y;

            int    i;
            string str;

            for (i = itemIndex + 1; i < count; ++i)
            {
                str        = menuItems[i];
                itemOffset = arial.MeasureString(str);
                fontManager.Draw(position, str);
                position.Y += itemOffset.Y;
            }

            for (i = 0; i < itemIndex; ++i)
            {
                str        = menuItems[i];
                itemOffset = arial.MeasureString(str);
                fontManager.Draw(position, str);
                position.Y += itemOffset.Y;
            }

            fontManager.End();
        }