示例#1
0
        private int CalculateXOptionOffset()
        {
            int maxLength = 0;

            foreach (MenuItem menuItem in _menuItems)
            {
                maxLength = Math.Max(maxLength, (int)FontManager.Fonts("LargeFont").MeasureString(menuItem.ItemText).X);
            }
            return((maxLength) + 25);
        }
示例#2
0
        private string ScrollText(string message)
        {
            var messageLength = FontManager.Fonts("DefaultFont").MeasureString(message);

            if (messageLength.X > 780)
            {
                XOffset -= TextureManager.LastGameTime.ElapsedRealTime.TotalSeconds * SCROLL_SPEED;
                if (XOffset < 0 - messageLength.X - 25)
                {
                    XOffset += (int)messageLength.X;
                }
                message = message + "" + message;
            }
            else
            {
                XOffset = 0;
            }
            return(message);
        }