示例#1
0
        public override void LoadContent(object obj = null)
        {
            this.timer = new Timer();

            this.background = new GameDynamicBackground(this.Game);

            this.menuButtonTexture = ContentHandler.Load <Texture2D>(GameResources.MenuButtonTextureName);
            this.tapButtonTexture  = ContentHandler.Load <Texture2D>(GameResources.TapButtonTextureName);
            this.logo = ContentHandler.Load <Texture2D>(GameResources.LogoTextureName);
            this.font = ContentHandler.Load <SpriteFont>(GameResources.FontSpriteFontName);

            this.logoImage          = new GameImage(this.Game, this.logo);
            this.logoImage.Position = new Vector2(this.Game.Window.ClientBounds.Width / 2 - this.logoImage.Texture.Width / 2, this.Game.Window.ClientBounds.Height / 4 - this.logoImage.Texture.Height / 2);

            this.playButton                 = new GameButton(this.Game, this.menuButtonTexture);
            this.playButton.Size            = new Vector2(300, 100);
            this.playButton.Text            = Resources.AppResources.ButtonPlayText;
            this.playButton.TextColor       = Color.White;
            this.playButton.BackgroundColor = new Color(90, 235, 130);
            this.playButton.Position        = new Vector2(Game.Window.ClientBounds.Width / 2 - this.playButton.Size.X / 2, Game.Window.ClientBounds.Height / 2 - this.playButton.Size.Y / 2);

            this.tutorialButton                 = new GameButton(this.Game, this.menuButtonTexture);
            this.tutorialButton.Size            = new Vector2(300, 100);
            this.tutorialButton.Text            = Resources.AppResources.ButtonTutorialText;
            this.tutorialButton.TextColor       = new Color(150, 150, 150);
            this.tutorialButton.BackgroundColor = Color.Gray;
            this.tutorialButton.BorderColor     = Color.Black;
            this.tutorialButton.Position        = new Vector2(this.playButton.Position.X, this.playButton.Position.Y + this.tutorialButton.Size.Y + 20);

            this.leaveButton                 = new GameButton(this.Game, this.menuButtonTexture);
            this.leaveButton.Size            = new Vector2(300, 100);
            this.leaveButton.Text            = Resources.AppResources.ButtonLeaveText;
            this.leaveButton.TextColor       = Color.White;
            this.leaveButton.BackgroundColor = Color.LightGray;
            this.leaveButton.BorderColor     = Color.Black;
            this.leaveButton.Position        = new Vector2(this.tutorialButton.Position.X, this.tutorialButton.Position.Y + this.leaveButton.Size.Y + 20);

            this.playButton.OnClick     += playButton_OnClick;
            this.tutorialButton.OnClick += TutorialButton_OnClick;
            this.leaveButton.OnClick    += LeaveButton_OnClick;

#if DEBUG
            notif = new GameSlideNotification(this.Game, this.font);
            notif.Label.BorderThickness = 1;
            notif.Label.BorderColor     = Color.Black;
            notif.Label.Color           = Color.White;
#endif
        }
示例#2
0
        public override void LoadContent(object obj = null)
        {
            this.validButtonTexture  = ContentHandler.Load <Texture2D>(GameResources.ValidGreenButton);
            this.replayButtonTexture = ContentHandler.Load <Texture2D>(GameResources.ReplayOrangeButton);
            this.homeButtonTexture   = ContentHandler.Load <Texture2D>(GameResources.HomeGrayButton);
            this.scoreItemTexture    = ContentHandler.Load <Texture2D>(GameResources.CustomerScoreBackground);
            this.fontTexture         = ContentHandler.Load <SpriteFont>(GameResources.FontSpriteFontName);

            GameScore     score        = obj as GameScore;
            CustomerScore currentScore = new CustomerScore("User", (score != null) ? (int)score.Score : -1);

            this.timer = new Timer();

            this.scoreItem                        = new GameScoreItem(this.Game, this.scoreItemTexture, this.fontTexture, currentScore);
            this.scoreItem.Color                  = Color.Orange;
            this.scoreItem.Size                   = new Vector2(Game.Window.ClientBounds.Width * 3 / 4, GameScoreItem.HEIGHT_DEFAULT);
            this.scoreItem.Label1.Color           = Color.White;
            this.scoreItem.Label1.BorderColor     = Color.Black;
            this.scoreItem.Label1.BorderThickness = 1;
            this.scoreItem.Label2.BorderColor     = Color.White;
            this.scoreItem.Label2.BorderThickness = 1;
            this.scoreItem.Position               = new Vector2(Game.Window.ClientBounds.Width / 2 - this.scoreItem.Size.X / 2, Game.Window.ClientBounds.Height / 6 - this.scoreItem.Size.Y / 2);


            this.scorePanel          = new GamePanel(this.Game);
            this.scorePanel.Size     = new Vector2(Game.Window.ClientBounds.Width * 3 / 4, 5 * GameScoreItem.HEIGHT_DEFAULT);
            this.scorePanel.Position = new Vector2(Game.Window.ClientBounds.Width / 2 - this.scorePanel.Size.X / 2, Game.Window.ClientBounds.Height * 2 / 5 - this.scorePanel.Size.Y / 2);

            this.scoresList.ForEach(item => this.scorePanel.Add(new GameScoreItem(this.Game, this.scoreItemTexture, this.fontTexture, item)));

            this.replayButton          = new GameButton(this.Game, this.replayButtonTexture);
            this.replayButton.Scale    = 1.5f;
            this.replayButton.Position = new Vector2(Game.Window.ClientBounds.Width / 4 - this.replayButton.Size.X / 2, Game.Window.ClientBounds.Height * 4 / 5 - this.replayButton.Size.Y / 2);

            this.homeButton          = new GameButton(this.Game, this.homeButtonTexture);
            this.homeButton.Scale    = 1.5f;
            this.homeButton.Position = new Vector2(Game.Window.ClientBounds.Width / 2 - this.homeButton.Size.X / 2, Game.Window.ClientBounds.Height * 4 / 5 - this.homeButton.Size.Y / 2);

            this.validButton          = new GameButton(this.Game, this.validButtonTexture);
            this.validButton.Scale    = 1.5f;
            this.validButton.Position = new Vector2(Game.Window.ClientBounds.Width * 3 / 4 - this.validButton.Size.X / 2, Game.Window.ClientBounds.Height * 4 / 5 - this.validButton.Size.Y / 2);

            this.replayButton.OnClick += replayButton_OnClick;
            this.homeButton.OnClick   += HomeButton_OnClick;
            this.validButton.OnClick  += ValidButton_OnClick;

            Thread.Sleep(1000);
        }
示例#3
0
        protected override void LoadContent()
        {
            this.SpriteBatch = new SpriteBatch(GraphicsDevice);
            ContentHandler.Add <Texture2D>(GameResources.LogoTextureName);
            ContentHandler.Add <Texture2D>(GameResources.MenuButtonTextureName);
            ContentHandler.Add <Texture2D>(GameResources.TapButtonTextureName);
            ContentHandler.Add <Texture2D>(GameResources.CustomerScoreBackground);
            ContentHandler.Add <Texture2D>(GameResources.RedCrossButton);
            ContentHandler.Add <Texture2D>(GameResources.HomeGrayButton);
            ContentHandler.Add <Texture2D>(GameResources.ReplayOrangeButton);
            ContentHandler.Add <Texture2D>(GameResources.ValidGreenButton);
            ContentHandler.Add <SpriteFont>(GameResources.FontSpriteFontName);


            // Load Designers
            MenuDesigner    = new MenuDesigner(this);
            PlayDesigner    = new PlayDesigner(this);
            EndMenuDesigner = new EndMenuDesigner(this);

            NavigationHelper.NavigateTo(GameState.Menu, TransitionType.None);

            base.LoadContent();
        }
示例#4
0
 public PlayDesigner(GameMain game) : base(game)
 {
     this.tapButtonTexture  = ContentHandler.Load <Texture2D>(GameResources.TapButtonTextureName);
     this.homeButtonTexture = ContentHandler.Load <Texture2D>(GameResources.HomeGrayButton);
     this.gameFont          = ContentHandler.Load <SpriteFont>(GameResources.FontSpriteFontName);
 }