Exemplo n.º 1
0
        private void CustomInitialize()
        {
            _mainGroup = UiControlManager.Instance.CreateSelectableControlGroup<SequentialSelectableGroup>();

            // Create the main layout
            _layout = UiControlManager.Instance.CreateControl<BoxLayout>();
            _layout.CurrentDirection = BoxLayout.Direction.Down;
            _layout.Spacing = 40;
            _layout.Margin = 50;
            _layout.BackgroundAnimationChains = GlobalContent.MenuBackground;
            _layout.CurrentBackgroundAnimationChainName = "Idle";
            _layout.BackgroundAlpha = 1;

            // Attach the layout to this entity so if we move the entity it moves the layout as well
            _layout.AttachTo(this, false);

            SpriteManager.AddToLayer(ArrowSprite, UiControlManager.Instance.Layer);

            InitButtons();
        }
Exemplo n.º 2
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);
        }