예제 #1
0
        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();
        }