public override void LoadContent() { SpriteFont font = FingerGames.Instance.Content.Load <SpriteFont>(@"Fonts\MenuFont"); HorizontalStackPanel horizontalPanel = new HorizontalStackPanel(); horizontalPanel.VerticalAlignment = VerticalAlignment.Top; horizontalPanel.FixedSize = false; horizontalPanel.Bounds = new Rectangle(0, 0, 800, 480); horizontalPanel.Padding = new Rectangle(10, 10, 10, 10); foreach (BaseGame game in new BaseGame[] { new Games.FingerRacerGame(FingerGames.Instance.GameManager), new Games.FingerRunnerGame(FingerGames.Instance.GameManager), new Games.FingerTwisterGame(FingerGames.Instance.GameManager) }) { _games.Add(game); game.LoadContent(); XnaImageButton imageButton = new XnaImageButton(game.Logo, new Rectangle(5, 5, 240, 240)); imageButton.Tag = game; imageButton.BackColor = Color.Gray; imageButton.Click += new EventHandler(imageButton_Click); XnaButton textButton = new XnaButton(new Rectangle(5, 5, 240, 60)); textButton.BorderWidth = 0; textButton.BackColor = Color.Transparent; textButton.Text = game.Title; textButton.Font = font; textButton.Tag = game; textButton.Click += new EventHandler(imageButton_Click); VerticalStackPanel panel = new VerticalStackPanel(); panel.Bounds = new Rectangle(0, 0, 240, 0); panel.HorizontalAlignment = HorizontalAlignment.Center; panel.AddChild(imageButton); panel.AddChild(textButton); horizontalPanel.AddChild(panel); } VerticalStackPanel vertPanel = new VerticalStackPanel(); vertPanel.Bounds = new Rectangle(0, 0, 800, 0); vertPanel.HorizontalAlignment = HorizontalAlignment.Center; vertPanel.AddChild(horizontalPanel); XnaButton playAllText = new XnaButton(new Rectangle(0, 480 - 60, 800, 60)); playAllText.BorderWidth = 0; playAllText.BackColor = Color.Transparent; playAllText.Text = "Play All Games"; playAllText.Font = font; playAllText.Tag = null; playAllText.Click += new EventHandler(imageButton_Click); this.Children.Add(vertPanel); this.Children.Add(playAllText); base.LoadContent(); }
public override void LoadContent() { _introLogo = FingerGames.Instance.Content.Load <Texture2D>(@"Textures\IntroLogo"); _pixel = FingerGames.Instance.Content.Load <Texture2D>(@"Textures\pixel"); _font = FingerGames.Instance.Content.Load <SpriteFont>(@"Fonts\MenuFont"); _introImage = new XnaImage(_introLogo, new Rectangle(800 - _introLogo.Width, 480 - _introLogo.Height, _introLogo.Width, _introLogo.Height)); _introImage.BlendColor = new Color(60, 60, 60); VerticalStackPanel panel = new VerticalStackPanel(); panel.HorizontalAlignment = HorizontalAlignment.Center; panel.Bounds = new Rectangle(10, 100, 780, 300); XnaLabel trialLabel1 = new XnaLabel(new Rectangle(0, 0, 800, 40)); trialLabel1.Font = _font; trialLabel1.FontZoom = 0.6f; trialLabel1.Text = "You are running the trial version of Fantastic Finger Fun."; XnaLabel trialLabel2 = new XnaLabel(new Rectangle(0, 0, 800, 40)); trialLabel2.Font = _font; trialLabel2.FontZoom = 0.6f; trialLabel2.Text = "The full version unlocks more race tracks,"; XnaLabel trialLabel3 = new XnaLabel(new Rectangle(0, 0, 800, 40)); trialLabel3.Font = _font; trialLabel3.FontZoom = 0.6f; trialLabel3.Text = "game modes, and challenges. To continue using"; XnaLabel trialLabel4 = new XnaLabel(new Rectangle(0, 0, 800, 40)); trialLabel4.Font = _font; trialLabel4.FontZoom = 0.6f; trialLabel4.Text = "the Trial mode, click the back button."; panel.AddChild(trialLabel1); panel.AddChild(trialLabel2); panel.AddChild(trialLabel3); panel.AddChild(trialLabel4); XnaButton purchaseButton = new XnaButton(new Rectangle(0, 400, 800, 80)); purchaseButton.BorderWidth = 0; purchaseButton.FontZoom = 0.8f; purchaseButton.HorizontalAlignment = HorizontalAlignment.Center; purchaseButton.Text = "Click Here To Purchase Fantastic Finger Fun..."; purchaseButton.Font = _font; purchaseButton.Click += new EventHandler(purchaseButton_Click); this.Children.Add(_introImage); this.Children.Add(panel); this.Children.Add(purchaseButton); base.LoadContent(); }
public override void LoadContent() { SpriteFont font = FingerGames.Instance.Content.Load<SpriteFont>(@"Fonts\MenuFont"); HorizontalStackPanel horizontalPanel = new HorizontalStackPanel(); horizontalPanel.VerticalAlignment = VerticalAlignment.Top; horizontalPanel.FixedSize = false; horizontalPanel.Bounds = new Rectangle(0, 0, 800, 480); horizontalPanel.Padding = new Rectangle(10, 10, 10, 10); foreach (BaseGame game in new BaseGame[] { new Games.FingerRacerGame(FingerGames.Instance.GameManager), new Games.FingerRunnerGame(FingerGames.Instance.GameManager), new Games.FingerTwisterGame(FingerGames.Instance.GameManager) }) { _games.Add(game); game.LoadContent(); XnaImageButton imageButton = new XnaImageButton(game.Logo, new Rectangle(5, 5, 240, 240)); imageButton.Tag = game; imageButton.BackColor = Color.Gray; imageButton.Click += new EventHandler(imageButton_Click); XnaButton textButton = new XnaButton(new Rectangle(5, 5, 240, 60)); textButton.BorderWidth = 0; textButton.BackColor = Color.Transparent; textButton.Text = game.Title; textButton.Font = font; textButton.Tag = game; textButton.Click += new EventHandler(imageButton_Click); VerticalStackPanel panel = new VerticalStackPanel(); panel.Bounds = new Rectangle(0, 0, 240, 0); panel.HorizontalAlignment = HorizontalAlignment.Center; panel.AddChild(imageButton); panel.AddChild(textButton); horizontalPanel.AddChild(panel); } VerticalStackPanel vertPanel = new VerticalStackPanel(); vertPanel.Bounds = new Rectangle(0, 0, 800, 0); vertPanel.HorizontalAlignment = HorizontalAlignment.Center; vertPanel.AddChild(horizontalPanel); XnaButton playAllText = new XnaButton(new Rectangle(0, 480 - 60, 800, 60)); playAllText.BorderWidth = 0; playAllText.BackColor = Color.Transparent; playAllText.Text = "Play All Games"; playAllText.Font = font; playAllText.Tag = null; playAllText.Click += new EventHandler(imageButton_Click); this.Children.Add(vertPanel); this.Children.Add(playAllText); base.LoadContent(); }
public void Prepare(GameManager gameManager, string scoreUnits) { _scoreLabel.Text = scoreUnits; _showContinueButton = false; while (_nameScorePanel.Children.Count > 1) { _nameScorePanel.Children.RemoveAt(1); } while (_scoreScorePanel.Children.Count > 1) { _scoreScorePanel.Children.RemoveAt(1); } while (_totalScorePanel.Children.Count > 1) { _totalScorePanel.Children.RemoveAt(1); } if (gameManager.Players.Count > 1) { _isScoreLoading = false; _totalLabel.Text = "Overall"; foreach (GamePlayer player in gameManager.Players) { XnaLabel nameLabel = new XnaButton(new Rectangle(0, 0, 300, 60)); nameLabel.Text = player.Name; nameLabel.Font = _menuFont; nameLabel.HorizontalAlignment = HorizontalAlignment.Left; _nameScorePanel.AddChild(nameLabel); XnaButton scoreLabel = new XnaButton(new Rectangle(0, 0, 250, 60)); scoreLabel.Text = string.Format("{0:0000.0}", player.Score); scoreLabel.Font = _menuFont; scoreLabel.HorizontalAlignment = HorizontalAlignment.Center; _scoreScorePanel.AddChild(scoreLabel); XnaButton totalLabel = new XnaButton(new Rectangle(0, 0, 250, 60)); totalLabel.Text = string.Format("{0:0000.0}", player.OverallScore); totalLabel.Font = _menuFont; totalLabel.HorizontalAlignment = HorizontalAlignment.Center; _totalScorePanel.AddChild(totalLabel); } } else { _totalLabel.Text = "Rank"; _isScoreLoading = true; ScoreCenterManager.RegisterScore(gameManager.GameName, gameManager.GameVariation, (float)gameManager.Players[0].Score, gameManager.SortDirection, new EventHandler <ScoreCenter.RegisterScoreCompletedEventArgs>(ScoresReady)); } }
public override void LoadContent() { _introLogo = FingerGames.Instance.Content.Load<Texture2D>(@"Textures\IntroLogo"); _pixel = FingerGames.Instance.Content.Load<Texture2D>(@"Textures\pixel"); _font = FingerGames.Instance.Content.Load<SpriteFont>(@"Fonts\MenuFont"); _introImage = new XnaImage(_introLogo, new Rectangle(800 - _introLogo.Width, 480 - _introLogo.Height, _introLogo.Width, _introLogo.Height)); _introImage.BlendColor = new Color(60,60,60); VerticalStackPanel panel = new VerticalStackPanel(); panel.HorizontalAlignment = HorizontalAlignment.Center; panel.Bounds = new Rectangle(10, 100, 780, 300); XnaLabel trialLabel1 = new XnaLabel(new Rectangle(0, 0, 800, 40)); trialLabel1.Font = _font; trialLabel1.FontZoom = 0.6f; trialLabel1.Text = "You are running the trial version of Fantastic Finger Fun."; XnaLabel trialLabel2 = new XnaLabel(new Rectangle(0, 0, 800, 40)); trialLabel2.Font = _font; trialLabel2.FontZoom = 0.6f; trialLabel2.Text = "The full version unlocks more race tracks,"; XnaLabel trialLabel3 = new XnaLabel(new Rectangle(0, 0, 800, 40)); trialLabel3.Font = _font; trialLabel3.FontZoom = 0.6f; trialLabel3.Text = "game modes, and challenges. To continue using"; XnaLabel trialLabel4 = new XnaLabel(new Rectangle(0, 0, 800, 40)); trialLabel4.Font = _font; trialLabel4.FontZoom = 0.6f; trialLabel4.Text = "the Trial mode, click the back button."; panel.AddChild(trialLabel1); panel.AddChild(trialLabel2); panel.AddChild(trialLabel3); panel.AddChild(trialLabel4); XnaButton purchaseButton = new XnaButton(new Rectangle(0, 400, 800, 80)); purchaseButton.BorderWidth = 0; purchaseButton.FontZoom = 0.8f; purchaseButton.HorizontalAlignment = HorizontalAlignment.Center; purchaseButton.Text = "Click Here To Purchase Fantastic Finger Fun..."; purchaseButton.Font = _font; purchaseButton.Click += new EventHandler(purchaseButton_Click); this.Children.Add(_introImage); this.Children.Add(panel); this.Children.Add(purchaseButton); base.LoadContent(); }
void imageButton_Click(object sender, EventArgs e) { XnaButton button = sender as XnaButton; if (null != button.Tag) { FingerGames.Instance.GameManager.SetGames(button.Tag as BaseGame); } else { FingerGames.Instance.GameManager.SetGames(_games.ToArray()); } FingerGames.Instance.SetStage(MobileSrc.FantasticFingerFun.Stage.InGame, true); }
public virtual void LoadContent() { _pixel = FingerGames.Instance.Content.Load <Texture2D>(@"Textures\pixel"); _menuFont = FingerGames.Instance.Content.Load <SpriteFont>(@"Fonts\MenuFont"); _resumeButton = new XnaButton(new Rectangle(0, 0, 800, 480)); _resumeButton.Text = "Tap Screen to Resume..."; _resumeButton.Click += new EventHandler(_resumeButton_Click); _scoreCenter = new XnaScoreCenter(); _scoreCenter.Bounds = new Rectangle(0, 0, 800, 480); _scoreCenter.ContinueClicked += new EventHandler(_scoreCenter_ContinueClicked); this.Assets.Add(_pixel); }
void soundToggle_SelectionChanged(object sender, EventArgs e) { XnaButton button = (XnaButton)sender; bool isSelected = !((bool)button.Tag); if (isSelected) { button.Text = "sound: on"; } else { button.Text = "sound: off"; } Settings.Instance.SoundsEnabled = isSelected; Settings.Instance.Save(); button.Tag = isSelected; }
private void ScoresReady(object sender, ScoreCenter.RegisterScoreCompletedEventArgs e) { _isScoreLoading = false; if (null != e) { foreach (ScoreCenter.ScoreItem item in e.Result) { float scale = (item.IsLast) ? 1.0f : .8f; int height = (item.IsLast) ? 45 : 35; Color foreColor = (item.IsLast) ? Color.LightBlue : Color.White; XnaButton nameLabel = new XnaButton(new Rectangle(0, 0, 300, height)); nameLabel.FontZoom = scale; nameLabel.Color = foreColor; nameLabel.Text = item.User; nameLabel.Font = _menuFont; nameLabel.HorizontalAlignment = HorizontalAlignment.Left; _nameScorePanel.AddChild(nameLabel); XnaButton scoreLabel = new XnaButton(new Rectangle(0, 0, 250, height)); scoreLabel.FontZoom = scale; scoreLabel.Color = foreColor; scoreLabel.Text = string.Format("{0:0000.0}", item.Score); scoreLabel.Font = _menuFont; scoreLabel.HorizontalAlignment = HorizontalAlignment.Center; _scoreScorePanel.AddChild(scoreLabel); XnaButton totalLabel = new XnaButton(new Rectangle(0, 0, 250, height)); totalLabel.FontZoom = scale; totalLabel.Color = foreColor; totalLabel.Text = string.Format("#{0}", item.Index); totalLabel.Font = _menuFont; totalLabel.HorizontalAlignment = HorizontalAlignment.Center; _totalScorePanel.AddChild(totalLabel); } } }
public virtual void LoadContent() { _pixel = FingerGames.Instance.Content.Load<Texture2D>(@"Textures\pixel"); _menuFont = FingerGames.Instance.Content.Load<SpriteFont>(@"Fonts\MenuFont"); _resumeButton = new XnaButton(new Rectangle(0, 0, 800, 480)); _resumeButton.Text = "Tap Screen to Resume..."; _resumeButton.Click += new EventHandler(_resumeButton_Click); _scoreCenter = new XnaScoreCenter(); _scoreCenter.Bounds = new Rectangle(0, 0, 800, 480); _scoreCenter.ContinueClicked += new EventHandler(_scoreCenter_ContinueClicked); this.Assets.Add(_pixel); }
public override void LoadContent() { _introLogo = FingerGames.Instance.Content.Load <Texture2D>(@"Textures\IntroLogo"); _introTitle = FingerGames.Instance.Content.Load <Texture2D>(@"Textures\IntroTitle"); _font = FingerGames.Instance.Content.Load <SpriteFont>(@"Fonts\MenuFont"); this.Assets.Add(_introLogo); this.Assets.Add(_introTitle); _introImage = new XnaImage(_introLogo, new Rectangle(800 - _introLogo.Width, 480 - _introLogo.Height, _introLogo.Width, _introLogo.Height)); this.Children.Add(_introImage); XnaImage titleImage = new XnaImage(_introTitle, new Rectangle(400 - _introTitle.Width / 2, 5, _introTitle.Width, _introTitle.Height)); this.Children.Add(titleImage); VerticalStackPanel panel = new VerticalStackPanel(); panel.HorizontalAlignment = HorizontalAlignment.Left; panel.Bounds = new Rectangle(titleImage.Bounds.X, 90, 100, 400); XnaButton singlePlayerButton = new XnaButton(new Rectangle(0, 0, 310, 54)); singlePlayerButton.BorderWidth = 0; singlePlayerButton.HorizontalAlignment = HorizontalAlignment.Left; singlePlayerButton.Text = "Single Player"; singlePlayerButton.Font = _font; singlePlayerButton.BackColor = Color.Transparent; singlePlayerButton.Click += new EventHandler(singlePlayerButton_Click); XnaButton multiPlayerButton = new XnaButton(new Rectangle(0, 0, 310, 54)); multiPlayerButton.BorderWidth = 0; multiPlayerButton.HorizontalAlignment = HorizontalAlignment.Left; multiPlayerButton.Text = "Two Player"; multiPlayerButton.Font = _font; multiPlayerButton.BackColor = Color.Transparent; multiPlayerButton.Click += new EventHandler(multiPlayerButton_Click); XnaButton soundToggle = new XnaButton(new Rectangle(0, 0, 310, 54)); soundToggle.Tag = !Settings.Instance.SoundsEnabled; soundToggle.BorderWidth = 0; soundToggle.HorizontalAlignment = HorizontalAlignment.Left; soundToggle.Font = _font; soundToggle.BackColor = Color.Transparent; soundToggle.Click += new EventHandler(soundToggle_SelectionChanged); soundToggle_SelectionChanged(soundToggle, null); XnaButton fingerArrowToggle = new XnaButton(new Rectangle(0, 0, 310, 54)); fingerArrowToggle.Tag = !Settings.Instance.ArrowsEnabled; fingerArrowToggle.BorderWidth = 0; fingerArrowToggle.HorizontalAlignment = HorizontalAlignment.Left; fingerArrowToggle.Font = _font; fingerArrowToggle.BackColor = Color.Transparent; fingerArrowToggle.Click += new EventHandler(fingerArrowToggle_SelectionChanged); fingerArrowToggle_SelectionChanged(fingerArrowToggle, null); panel.AddChild(singlePlayerButton); panel.AddChild(multiPlayerButton); panel.AddChild(fingerArrowToggle); panel.AddChild(soundToggle); XnaButton exitButton = new XnaButton(new Rectangle(titleImage.Bounds.Right - 310, 480 - 64, 310, 64)); exitButton.BorderWidth = 0; exitButton.HorizontalAlignment = HorizontalAlignment.Right; exitButton.Text = "Exit"; exitButton.Font = _font; exitButton.BackColor = Color.Transparent; exitButton.Click += new EventHandler(exitButton_Click); XnaButton helpButton = new XnaButton(new Rectangle(titleImage.Bounds.X, 480 - 64, 310, 64)); helpButton.BorderWidth = 0; helpButton.HorizontalAlignment = HorizontalAlignment.Left; helpButton.Text = "Help"; helpButton.Font = _font; helpButton.BackColor = Color.Transparent; helpButton.Click += new EventHandler(helpButton_Click); this.Children.Add(panel); this.Children.Add(exitButton); this.Children.Add(helpButton); base.LoadContent(); }
public override void LoadContent() { _introLogo = FingerGames.Instance.Content.Load<Texture2D>(@"Textures\IntroLogo"); _introTitle = FingerGames.Instance.Content.Load<Texture2D>(@"Textures\IntroTitle"); _font = FingerGames.Instance.Content.Load<SpriteFont>(@"Fonts\MenuFont"); this.Assets.Add(_introLogo); this.Assets.Add(_introTitle); _introImage = new XnaImage(_introLogo, new Rectangle(800 - _introLogo.Width, 480 - _introLogo.Height, _introLogo.Width, _introLogo.Height)); this.Children.Add(_introImage); XnaImage titleImage = new XnaImage(_introTitle, new Rectangle(400 - _introTitle.Width / 2, 5, _introTitle.Width, _introTitle.Height)); this.Children.Add(titleImage); VerticalStackPanel panel = new VerticalStackPanel(); panel.HorizontalAlignment = HorizontalAlignment.Left; panel.Bounds = new Rectangle(titleImage.Bounds.X, 90, 100, 400); XnaButton singlePlayerButton = new XnaButton(new Rectangle(0, 0, 310, 54)); singlePlayerButton.BorderWidth = 0; singlePlayerButton.HorizontalAlignment = HorizontalAlignment.Left; singlePlayerButton.Text = "Single Player"; singlePlayerButton.Font = _font; singlePlayerButton.BackColor = Color.Transparent; singlePlayerButton.Click += new EventHandler(singlePlayerButton_Click); XnaButton multiPlayerButton = new XnaButton(new Rectangle(0, 0, 310, 54)); multiPlayerButton.BorderWidth = 0; multiPlayerButton.HorizontalAlignment = HorizontalAlignment.Left; multiPlayerButton.Text = "Two Player"; multiPlayerButton.Font = _font; multiPlayerButton.BackColor = Color.Transparent; multiPlayerButton.Click += new EventHandler(multiPlayerButton_Click); XnaButton soundToggle = new XnaButton(new Rectangle(0, 0, 310, 54)); soundToggle.Tag = !Settings.Instance.SoundsEnabled; soundToggle.BorderWidth = 0; soundToggle.HorizontalAlignment = HorizontalAlignment.Left; soundToggle.Font = _font; soundToggle.BackColor = Color.Transparent; soundToggle.Click += new EventHandler(soundToggle_SelectionChanged); soundToggle_SelectionChanged(soundToggle, null); XnaButton fingerArrowToggle = new XnaButton(new Rectangle(0, 0, 310, 54)); fingerArrowToggle.Tag = !Settings.Instance.ArrowsEnabled; fingerArrowToggle.BorderWidth = 0; fingerArrowToggle.HorizontalAlignment = HorizontalAlignment.Left; fingerArrowToggle.Font = _font; fingerArrowToggle.BackColor = Color.Transparent; fingerArrowToggle.Click += new EventHandler(fingerArrowToggle_SelectionChanged); fingerArrowToggle_SelectionChanged(fingerArrowToggle, null); panel.AddChild(singlePlayerButton); panel.AddChild(multiPlayerButton); panel.AddChild(fingerArrowToggle); panel.AddChild(soundToggle); XnaButton exitButton = new XnaButton(new Rectangle(titleImage.Bounds.Right - 310, 480 - 64, 310, 64)); exitButton.BorderWidth = 0; exitButton.HorizontalAlignment = HorizontalAlignment.Right; exitButton.Text = "Exit"; exitButton.Font = _font; exitButton.BackColor = Color.Transparent; exitButton.Click += new EventHandler(exitButton_Click); XnaButton helpButton = new XnaButton(new Rectangle(titleImage.Bounds.X, 480 - 64, 310, 64)); helpButton.BorderWidth = 0; helpButton.HorizontalAlignment = HorizontalAlignment.Left; helpButton.Text = "Help"; helpButton.Font = _font; helpButton.BackColor = Color.Transparent; helpButton.Click += new EventHandler(helpButton_Click); this.Children.Add(panel); this.Children.Add(exitButton); this.Children.Add(helpButton); base.LoadContent(); }
public XnaScoreCenter() { if (null == _menuFont) { _menuFont = FingerGames.Instance.Content.Load <SpriteFont>(@"Fonts\MenuFont"); } _continueButton = new XnaButton(new Rectangle(0, 400, 800, 80)); _continueButton.Text = "Tap Here to Continue..."; _continueButton.Click += new EventHandler(_continueButton_Click); _horizontalScorePanel = new HorizontalStackPanel(); _horizontalScorePanel.VerticalAlignment = VerticalAlignment.Top; _horizontalScorePanel.Bounds = new Rectangle(0, 0, 800, 400); _horizontalScorePanel.Padding = new Rectangle(0, 0, 0, 0); _nameScorePanel = new VerticalStackPanel(); _nameScorePanel.HorizontalAlignment = HorizontalAlignment.Left; _nameScorePanel.FixedSize = true; _nameScorePanel.Bounds = new Rectangle(0, 0, 300, 400); _nameScorePanel.BorderColor = Color.White; _nameScorePanel.BorderWidth = 1; _scoreScorePanel = new VerticalStackPanel(); _scoreScorePanel.FixedSize = true; _scoreScorePanel.Bounds = new Rectangle(0, 0, 250, 400); _scoreScorePanel.BorderColor = Color.White; _scoreScorePanel.BorderWidth = 1; _totalScorePanel = new VerticalStackPanel(); _totalScorePanel.FixedSize = true; _totalScorePanel.Bounds = new Rectangle(0, 0, 250, 400); _totalScorePanel.BorderColor = Color.White; _totalScorePanel.BorderWidth = 1; XnaLabel nameLabel = new XnaButton(new Rectangle(0, 0, 300, 70)); nameLabel.Text = "Name"; nameLabel.FontZoom = 1.25f; nameLabel.Font = _menuFont; nameLabel.HorizontalAlignment = HorizontalAlignment.Left; _nameScorePanel.AddChild(nameLabel); _scoreLabel = new XnaButton(new Rectangle(0, 0, 250, 70)); _scoreLabel.Text = "Score"; _scoreLabel.FontZoom = 1.25f; _scoreLabel.Font = _menuFont; _scoreLabel.HorizontalAlignment = HorizontalAlignment.Center; _scoreScorePanel.AddChild(_scoreLabel); _totalLabel = new XnaButton(new Rectangle(0, 0, 250, 70)); _totalLabel.Text = "Overall"; _totalLabel.FontZoom = 1.25f; _totalLabel.Font = _menuFont; _totalLabel.HorizontalAlignment = HorizontalAlignment.Center; _totalScorePanel.AddChild(_totalLabel); _horizontalScorePanel.AddChild(_nameScorePanel); _horizontalScorePanel.AddChild(_scoreScorePanel); _horizontalScorePanel.AddChild(_totalScorePanel); _scorePanel = new VerticalStackPanel(); _scorePanel.Bounds = new Rectangle(0, 0, 800, 480); _scorePanel.FixedSize = true; _scorePanel.AddChild(_horizontalScorePanel); _scorePanel.AddChild(_continueButton); _loadingLabel = new XnaLabel(new Rectangle(0, 0, 800, 480)); _loadingLabel.Text = "Loading..."; _continueButton.Click += new EventHandler(_continueButton_Click); }
public XnaScoreCenter() { if (null == _menuFont) { _menuFont = FingerGames.Instance.Content.Load<SpriteFont>(@"Fonts\MenuFont"); } _continueButton = new XnaButton(new Rectangle(0, 400, 800, 80)); _continueButton.Text = "Tap Here to Continue..."; _continueButton.Click += new EventHandler(_continueButton_Click); _horizontalScorePanel = new HorizontalStackPanel(); _horizontalScorePanel.VerticalAlignment = VerticalAlignment.Top; _horizontalScorePanel.Bounds = new Rectangle(0, 0, 800, 400); _horizontalScorePanel.Padding = new Rectangle(0, 0, 0, 0); _nameScorePanel = new VerticalStackPanel(); _nameScorePanel.HorizontalAlignment = HorizontalAlignment.Left; _nameScorePanel.FixedSize = true; _nameScorePanel.Bounds = new Rectangle(0, 0, 300, 400); _nameScorePanel.BorderColor = Color.White; _nameScorePanel.BorderWidth = 1; _scoreScorePanel = new VerticalStackPanel(); _scoreScorePanel.FixedSize = true; _scoreScorePanel.Bounds = new Rectangle(0, 0, 250, 400); _scoreScorePanel.BorderColor = Color.White; _scoreScorePanel.BorderWidth = 1; _totalScorePanel = new VerticalStackPanel(); _totalScorePanel.FixedSize = true; _totalScorePanel.Bounds = new Rectangle(0, 0, 250, 400); _totalScorePanel.BorderColor = Color.White; _totalScorePanel.BorderWidth = 1; XnaLabel nameLabel = new XnaButton(new Rectangle(0, 0, 300, 70)); nameLabel.Text = "Name"; nameLabel.FontZoom = 1.25f; nameLabel.Font = _menuFont; nameLabel.HorizontalAlignment = HorizontalAlignment.Left; _nameScorePanel.AddChild(nameLabel); _scoreLabel = new XnaButton(new Rectangle(0, 0, 250, 70)); _scoreLabel.Text = "Score"; _scoreLabel.FontZoom = 1.25f; _scoreLabel.Font = _menuFont; _scoreLabel.HorizontalAlignment = HorizontalAlignment.Center; _scoreScorePanel.AddChild(_scoreLabel); _totalLabel = new XnaButton(new Rectangle(0, 0, 250, 70)); _totalLabel.Text = "Overall"; _totalLabel.FontZoom = 1.25f; _totalLabel.Font = _menuFont; _totalLabel.HorizontalAlignment = HorizontalAlignment.Center; _totalScorePanel.AddChild(_totalLabel); _horizontalScorePanel.AddChild(_nameScorePanel); _horizontalScorePanel.AddChild(_scoreScorePanel); _horizontalScorePanel.AddChild(_totalScorePanel); _scorePanel = new VerticalStackPanel(); _scorePanel.Bounds = new Rectangle(0, 0, 800, 480); _scorePanel.FixedSize = true; _scorePanel.AddChild(_horizontalScorePanel); _scorePanel.AddChild(_continueButton); _loadingLabel = new XnaLabel(new Rectangle(0, 0, 800, 480)); _loadingLabel.Text = "Loading..."; _continueButton.Click += new EventHandler(_continueButton_Click); }
public void Prepare(GameManager gameManager, string scoreUnits) { _scoreLabel.Text = scoreUnits; _showContinueButton = false; while (_nameScorePanel.Children.Count > 1) { _nameScorePanel.Children.RemoveAt(1); } while (_scoreScorePanel.Children.Count > 1) { _scoreScorePanel.Children.RemoveAt(1); } while (_totalScorePanel.Children.Count > 1) { _totalScorePanel.Children.RemoveAt(1); } if (gameManager.Players.Count > 1) { _isScoreLoading = false; _totalLabel.Text = "Overall"; foreach (GamePlayer player in gameManager.Players) { XnaLabel nameLabel = new XnaButton(new Rectangle(0, 0, 300, 60)); nameLabel.Text = player.Name; nameLabel.Font = _menuFont; nameLabel.HorizontalAlignment = HorizontalAlignment.Left; _nameScorePanel.AddChild(nameLabel); XnaButton scoreLabel = new XnaButton(new Rectangle(0, 0, 250, 60)); scoreLabel.Text = string.Format("{0:0000.0}", player.Score); scoreLabel.Font = _menuFont; scoreLabel.HorizontalAlignment = HorizontalAlignment.Center; _scoreScorePanel.AddChild(scoreLabel); XnaButton totalLabel = new XnaButton(new Rectangle(0, 0, 250, 60)); totalLabel.Text = string.Format("{0:0000.0}", player.OverallScore); totalLabel.Font = _menuFont; totalLabel.HorizontalAlignment = HorizontalAlignment.Center; _totalScorePanel.AddChild(totalLabel); } } else { _totalLabel.Text = "Rank"; _isScoreLoading = true; ScoreCenterManager.RegisterScore(gameManager.GameName, gameManager.GameVariation, (float)gameManager.Players[0].Score, gameManager.SortDirection, new EventHandler<ScoreCenter.RegisterScoreCompletedEventArgs>(ScoresReady)); } }