Example #1
0
        public MenuScreen(Game1 game, string title)
            : base(game)
        {
            Font = Content.Load<SpriteFont>("MyFont");

            Vector2 origin = Font.MeasureString(title) * 0.5f;
            Vector2 position = game.Camera.ScreenSize * 0.5f;
            position.Y = origin.Y + position.Y * 0.15f;

            Entries = new List<MenuEntry>();

            //Add the title text.
            titleText = new TextObject(title)
            {
                Color = Color.White,
                Effect = SpriteEffects.None,
                Position = position,
                Scale = 1.5f
            };

            LastState = Keyboard.GetState();
            CurrentIndex = 0;

            game.Background = Color.Black;

            game.IsMouseVisible = true;
        }
Example #2
0
 public TextState(TextObject parent)
 {
     Parent = parent;
 }