protected override void CreateScene() { FixedCamera2D camera2d = new FixedCamera2D("camera"); camera2d.BackgroundColor = Color.Gray; EntityManager.Add(camera2d); // Panel wrapPanel = new WrapPanel() { Width = 400, Height = 220, Orientation = Orientation.Horizontal, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, }; EntityManager.Add(wrapPanel.Entity); // Elements Button button; for (int i = 0; i < 5; i++) { button = new Button() { Text = i.ToString(), Width = 100, Height = 100, Foreground = Color.Yellow, BackgroundColor = Color.Red, }; wrapPanel.Add(button); } // Set Orientation Button button1 = new Button() { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Bottom, Text = "Change Orientation", Width = 200, Margin = new Thickness(20), Foreground = Color.LightPink, BackgroundColor = Color.Purple, BorderColor = Color.LightPink, }; button1.Click += b_Click; EntityManager.Add(button1.Entity); // Debug this.CreateDebugMode(); }
protected override void CreateScene() { //Indicamos que no limpie la pantalla al pintar RenderManager.ClearFlags = ClearFlags.DepthAndStencil; WrapPanel container = new WrapPanel() { Width = 400, Height = 200, BackgroundColor = Color.Red, Opacity = 0.05f }; EntityManager.Add(container.Entity); this.AddSceneBehavior(new PauseSceneBehavior(), SceneBehavior.Order.PreUpdate); #if DEBUG this.AddSceneBehavior(new DebugSceneBehavior(), SceneBehavior.Order.PreUpdate); #endif }