/// <summary> /// Resolves the dependencies needed for this instance to work. /// </summary> protected override void ResolveDependencies() { this.gamePlayScene = this.Scene as GamePlayScene; this.scoreboardPanel = this.gamePlayScene.EntityManager.Find<ScoreboardPanel>("scoreboardPanel"); this.target = this.gamePlayScene.EntityManager.Find<Entity>("BallTarget"); this.targetTransform = this.target.FindComponent<Transform2D>(); this.start = this.gamePlayScene.EntityManager.Find<Entity>("BallStart"); this.startTransform = this.start.FindComponent<Transform2D>(); }
private void CreateUI() { // Pause button this.b_pause = new Button() { IsBorder = false, Text = string.Empty, BackgroundImage = WaveContent.Assets.Textures.pause_bt_PNG, PressedBackgroundImage = WaveContent.Assets.Textures.pause_bt_pressed_PNG, HorizontalAlignment = HorizontalAlignment.Right, VerticalAlignment = VerticalAlignment.Top, Margin = new Thickness(0, WaveServices.ViewportManager.TopEdge + 10, 10, 0), }; this.b_pause.Click += (s, o) => { SoundsManager.Instance.PlaySound(SoundsManager.SOUNDS.Button); WaveServices.ScreenContextManager.Push(new ScreenContext(new PauseScene(this))); }; EntityManager.Add(this.b_pause); // Ready! Go! Timeout! this.messagePanel = new MessagePanel(MessagePanel.MessageType.HurryUp) { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, }; EntityManager.Add(this.messagePanel); // Stadistics this.stadisticsPanel = new StadisticsPanel() { HorizontalAlignment = HorizontalAlignment.Center, Margin = new Thickness(0, WaveServices.ViewportManager.TopEdge, 0, 0), }; EntityManager.Add(this.stadisticsPanel); // HighScore this.highScorePanel = new HighScorePanel() { HorizontalAlignment = HorizontalAlignment.Right, Margin = new Thickness(0, 100, 0, 0), }; EntityManager.Add(this.highScorePanel); // Combo this.comboPanel = new ComboPanel(new Vector2(WaveServices.ViewportManager.VirtualWidth / 2, WaveServices.ViewportManager.TopEdge + 150)); EntityManager.Add(this.comboPanel); // Scoreboard this.scoreboardPanel = new ScoreboardPanel(this.comboPanel) { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Top, Margin = new Thickness(0, WaveServices.ViewportManager.TopEdge, 0, 0), }; EntityManager.Add(this.scoreboardPanel); }
/// <summary> /// Resolves the dependencies needed for this instance to work. /// </summary> protected override void ResolveDependencies() { base.ResolveDependencies(); this.scoreboardPanel = ((GamePlayScene)this.Owner.Scene).scoreboardPanel; }