Esempio n. 1
0
        private void CustomInitialize()
        {
            _layout = UiControlManager.Instance.CreateControl<BoxLayout>();
            _layout.CurrentDirection = BoxLayout.Direction.Down;
            _layout.Spacing = 20;
            _layout.Margin = 20;
            _layout.BackgroundAnimationChains = GlobalContent.MenuBackground;
            _layout.CurrentBackgroundAnimationChainName = "Idle";
            _layout.AttachTo(this, false);

            // Add the text and the loading image
            _text = UiControlManager.Instance.CreateControl<LayoutableText>();
            _text.DisplayText = "Loading Level";
            _layout.AddItem(_text, BoxLayout.Alignment.Centered);

            var img = UiControlManager.Instance.CreateControl<LayoutableSprite>();
            img.AnimationChains = GlobalContent.LoadingAnimation;
            img.CurrentAnimationChainName = "Loading";
            _layout.AddItem(img, BoxLayout.Alignment.Centered);
        }
 private void CreateButtonsForLayout(BoxLayout layout)
 {
     for (int x = 0; x < 5; x++)
     {
         var btn = CreateButton();
         btn.Text = "Button # " + x;
         btn.ResizeAroundText(5, 5);
         layout.AddItem(btn);
     }
 }