private void CreateUI() { // Side black panels Entity rightBlackpanel = new Entity() .AddComponent(new Transform2D() { DrawOrder = 1f, X = WaveServices.ViewportManager.LeftEdge }) .AddComponent(new ImageControl( Color.Black, (int)-WaveServices.ViewportManager.LeftEdge, (int)WaveServices.ViewportManager.VirtualHeight)) .AddComponent(new ImageControlRenderer(DefaultLayers.GUI)); EntityManager.Add(rightBlackpanel); Entity leftBlackpanel = new Entity() .AddComponent(new Transform2D() { DrawOrder = 1f, X = WaveServices.ViewportManager.VirtualWidth }) .AddComponent(new ImageControl( Color.Black, (int)-WaveServices.ViewportManager.LeftEdge, (int)WaveServices.ViewportManager.VirtualHeight)) .AddComponent(new ImageControlRenderer(DefaultLayers.GUI)); EntityManager.Add(leftBlackpanel); // ScorePanel ScorePanel scorePanel = new ScorePanel("ScorePanel"); this.EntityManager.Add(scorePanel); }
protected override void Initialize() { base.Initialize(); this.scorePanel = this.EntityManager.Find<ScorePanel>("ScorePanel"); //Backscene var backContext = WaveServices.ScreenContextManager.FindContextByName("BackContext"); if (backContext != null) { this.backScene = backContext.FindScene<BackgroundScene>(); } this.blockBuilder = this.EntityManager.Find("BlockBuilder").FindComponent<BlockBuilderBehavior>(); this.squid = this.EntityManager.Find("Squid").FindComponent<SquidBehavior>(); }