Пример #1
0
 public Program()
 {
     Content.RootDirectory = "Content";
     graphics = new GraphicsDeviceManager(this);
     graphics.PreferredBackBufferWidth  = 648;
     graphics.PreferredBackBufferHeight = 486;
     screenManager = new screenManager(this);
     Components.Add(screenManager);
     screenManager.AddScreen(new backgroundScreen(), null);
     screenManager.AddScreen(new MainMenu(), null);
 }
Пример #2
0
        public virtual void Draw(menuScreen screen, bool isChosen, GameTime gameTime)
        {
            Color color = isChosen ? Color.DarkGray : Color.Black;

            double time  = gameTime.TotalGameTime.TotalSeconds;
            float  pulse = (float)Math.Sin(time * 6) + 1;
            float  scale = 1 + pulse * 0.05f * fade;

            color *= screen.transAlpha;

            screenManager screenManager = screen.SManager;
            SpriteBatch   spriteBatch   = screenManager.SpriteBatch;
            SpriteFont    font          = screenManager.Font;

            Vector2 origin = new Vector2(0, font.LineSpacing / 2);

            spriteBatch.DrawString(font, text, position, color, 0, origin, scale, SpriteEffects.None, 0);
        }