Пример #1
0
        /// <summary>
        /// Constructs a new screen manager component.
        /// </summary>
        public ScreenManager(Microsoft.Xna.Framework.Game game, GraphicsDeviceManager graphics) : base(game)
        {
            this.graphics = graphics;

            // we must set EnabledGestures before we can query for them, but
            // we don't assume the game wants to read them.
            Level = 0;

            UserName = "";

            keyBoard         = new OnScreenKeyboard(this);
            keyBoard.Enabled = false;
        }
Пример #2
0
        public TextInput(GraphicsDevice device, OnScreenKeyboard keyboard, Rectangle rect, Color color)
        {
            this.keyboard = keyboard;
            this.rect     = rect;
            this.color    = color;
            drawtex       = new Texture2D(device, 1, 1);

            Color[] data = new Color[1];
            data[0] = new Color(255, 255, 255, 180);
            drawtex.SetData <Color>(data);
            Vector2 size = keyboard.Font.MeasureString(Title);

            backgroundrect = new Rectangle(rect.X + 5, rect.Y + 5 + (int)size.Y, rect.Width - 10, (int)size.Y);
            buttondrect    = new Rectangle(rect.X + (rect.Width / 2) - 5,
                                           rect.Y + 20 + (int)size.Y * 2,
                                           rect.Width / 2 - 20, (int)size.Y + 20);

            backgroudcolor = new Color(255, 255, 255, 180);
            fcolor         = new Color(0, 0, 0, 180);
        }