Exemplo n.º 1
0
        // basic screen with a background and menu
        public Screen(Game game, SpriteBatch spriteBatch, Texture2D backgroundImage, string[] menuItems)
            : base(game)
        {
            this.spriteBatch = spriteBatch;
            this.spriteFont = game.Font;
            this.backgroundImage = backgroundImage;

            position = Vector2.Zero;
            width = game.Window.ClientBounds.Width;
            height = game.Window.ClientBounds.Height;

            menu = new Menu(game, this, spriteBatch, spriteFont, menuItems);
            components.Add(menu);
        }
Exemplo n.º 2
0
        // popup with menu
        public scrPopup(Game game, SpriteBatch spriteBatch, Texture2D backgroundImage, Screen parentScreen, string[] menuItems, int width = 300, int height = 400)
            : base(game, spriteBatch, backgroundImage)
        {
            this.parentScreen = parentScreen;

            this.backgroundImage = backgroundImage;
            this.backgroundShadow = new ContentManager(game.Services, Settings.Content_Background).Load<Texture2D>("Shadow");

            this.width = width;
            this.height = height;
            MeasureScreen();

            menu = new Menu(game, this, spriteBatch, spriteFont, menuItems);
            components.Add(menu);
        }